1
0
Fork 0

More useful store test helper functions

master
Philip O'Toole 4 years ago
parent 65944f6c15
commit aa2fec4a1f

@ -1261,10 +1261,7 @@ func Test_State(t *testing.T) {
} }
} }
func mustNewStore(inmem bool) *Store { func mustNewStoreAtPath(path string, inmem bool) *Store {
path := mustTempDir()
defer os.RemoveAll(path)
cfg := NewDBConfig("", inmem) cfg := NewDBConfig("", inmem)
s := New(mustMockLister("localhost:0"), &StoreConfig{ s := New(mustMockLister("localhost:0"), &StoreConfig{
DBConf: cfg, DBConf: cfg,
@ -1277,6 +1274,10 @@ func mustNewStore(inmem bool) *Store {
return s return s
} }
func mustNewStore(inmem bool) *Store {
return mustNewStoreAtPath(mustTempDir(), inmem)
}
type mockSnapshotSink struct { type mockSnapshotSink struct {
*os.File *os.File
} }

Loading…
Cancel
Save