(t *testing.T)
| 11 | ) |
| 12 | |
| 13 | func TestFileStorageStoreLoad(t *testing.T) { |
| 14 | ctx := context.Background() |
| 15 | tmpDir, err := os.MkdirTemp(os.TempDir(), "certmagic*") |
| 16 | testutil.RequireNoError(t, err, "allocating tmp dir") |
| 17 | defer os.RemoveAll(tmpDir) |
| 18 | s := &certmagic.FileStorage{ |
| 19 | Path: tmpDir, |
| 20 | } |
| 21 | err = s.Store(ctx, "foo", []byte("bar")) |
| 22 | testutil.RequireNoError(t, err) |
| 23 | dat, err := s.Load(ctx, "foo") |
| 24 | testutil.RequireNoError(t, err) |
| 25 | testutil.RequireEqualValues(t, dat, []byte("bar")) |
| 26 | } |
| 27 | |
| 28 | func TestFileStorageStoreLoadRace(t *testing.T) { |
| 29 | ctx := context.Background() |
nothing calls this directly
no test coverage detected
searching dependent graphs…