6 "github.com/mjl-/mox/imapclient"
9func TestQuota1(t *testing.T) {
13 tc.client.Login("mjl@mox.example", password0)
15 // We don't implement setquota.
16 tc.transactf("bad", `setquota "" (STORAGE 123)`)
18 tc.transactf("bad", "getquotaroot") // Missing param.
19 tc.transactf("bad", "getquotaroot inbox bogus") // Too many params.
21 tc.transactf("bad", "getquota") // Missing param.
22 tc.transactf("bad", "getquota a b") // Too many params.
24 // tc does not have a limit.
25 tc.transactf("ok", "getquotaroot inbox")
26 tc.xuntagged(imapclient.UntaggedQuotaroot([]string{""}))
28 tc.transactf("no", "getquota bogusroot")
29 tc.transactf("ok", `getquota ""`)
32 // Check that we get a DELETED-STORAGE status attribute with value 0, also if
33 // messages are marked deleted. We don't go through the trouble.
34 tc.transactf("ok", "status inbox (DELETED-STORAGE)")
35 tc.xuntagged(imapclient.UntaggedStatus{Mailbox: "Inbox", Attrs: map[imapclient.StatusAttr]int64{imapclient.StatusDeletedStorage: 0}})
37 // tclimit does have a limit.
38 tclimit := startArgs(t, false, false, true, true, "limit")
41 tclimit.client.Login("limit@mox.example", password0)
43 tclimit.transactf("ok", "getquotaroot inbox")
45 imapclient.UntaggedQuotaroot([]string{""}),
46 imapclient.UntaggedQuota{Root: "", Resources: []imapclient.QuotaResource{{Name: imapclient.QuotaResourceStorage, Usage: 0, Limit: 1}}},
49 tclimit.transactf("ok", `getquota ""`)
50 tclimit.xuntagged(imapclient.UntaggedQuota{Root: "", Resources: []imapclient.QuotaResource{{Name: imapclient.QuotaResourceStorage, Usage: 0, Limit: 1}}})
52 tclimit.transactf("ok", "status inbox (DELETED-STORAGE)")
53 tclimit.xuntagged(imapclient.UntaggedStatus{Mailbox: "Inbox", Attrs: map[imapclient.StatusAttr]int64{imapclient.StatusDeletedStorage: 0}})