mirror of
https://github.com/mjl-/mox.git
synced 2025-07-19 00:46:36 +03:00
In tests, make initializing store/, its switchboard and an account more consistent.
Initialize store and switchboard first, then open account, and close in reverse order. Replace all "CheckClosed" calls with "WaitClosed", future changings will keep an account reference open for a bit after the last regular close, so we can't know that an account should be closed during tests. Remove one parameter from the (still too long) "start test server" function in imapserver testing code.
This commit is contained in:
13
ctl_test.go
13
ctl_test.go
@ -49,15 +49,14 @@ func TestCtl(t *testing.T) {
|
||||
if errs := mox.LoadConfig(ctxbg, pkglog, true, false); len(errs) > 0 {
|
||||
t.Fatalf("loading mox config: %v", errs)
|
||||
}
|
||||
defer store.Switchboard()()
|
||||
|
||||
err := queue.Init()
|
||||
tcheck(t, err, "queue init")
|
||||
defer queue.Shutdown()
|
||||
|
||||
err = store.Init(ctxbg)
|
||||
err := store.Init(ctxbg)
|
||||
tcheck(t, err, "store init")
|
||||
defer store.Close()
|
||||
defer store.Switchboard()()
|
||||
|
||||
err = queue.Init()
|
||||
tcheck(t, err, "queue init")
|
||||
defer queue.Shutdown()
|
||||
|
||||
var cid int64
|
||||
|
||||
|
Reference in New Issue
Block a user