From b079ca84c129e2063c89fcab8461c160f471e83b Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Wed, 7 Oct 2009 19:26:12 +0000 Subject: [PATCH] Monotone-Parent: 55a3e83df8d5652ae3ebeec99432c0ae7f1e8c29 Monotone-Revision: 3a1e839e777209a5f153550867aea93a059ef056 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2009-10-07T19:26:12 Monotone-Branch: ca.inverse.sogo --- Tests/test-maildav.py | 47 ++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 46 insertions(+), 1 deletion(-) diff --git a/Tests/test-maildav.py b/Tests/test-maildav.py index 181e1ce66..984b2423b 100755 --- a/Tests/test-maildav.py +++ b/Tests/test-maildav.py @@ -490,6 +490,37 @@ class DAVMailCollectionTest(unittest.TestCase): ## 1. test filter: size # LARGER, SMALLER + #1 848 + #2 4308 + #3 699 + filters = (({ "size": { "min": "300", + "max": "300" }}, + []), + ({ "size": { "min": "800", + "max": "800" }}, + []), + ({ "size": { "min": "5000", + "max": "5000" }}, + []), + ({ "size": { "min": "838", + "max": "838" }}, + [ msg1Loc ]), + ({ "size": { "min": "699", + "max": "4308" }}, + [ msg1Loc, msg2Loc, msg3Loc ]), + ({ "size": { "min": "700", + "max": "4308" }}, + [ msg1Loc, msg2Loc ]), + ({ "size": { "min": "698", + "max": "848" }}, + [ msg1Loc, msg3Loc ]), + ({ "size": { "min": "300", + "max": "5000" }, + "size": { "min": "840", + "max": "850", + "not": "true" }}, + [ msg2Loc, msg3Loc ])) + ## 1. test filter: answered # ANSWERED, UNANSWERED ## 1. test filter: draft @@ -505,6 +536,21 @@ class DAVMailCollectionTest(unittest.TestCase): ## 1. test filter: keywords # KEYWORD x + ## 1. test filter: multiple combinations + filters = (({ "body": { "match": "Hello" }, + "cc": { "match": "message1cc" }}, + [ msg1Loc ]), + ({ "to": { "match": "message" }, + "uid": { "from": "1", + "to": "2" }}, + [ msg1Loc, msg2Loc ]), + ({ "to": { "match": "message" }, + "uid": { "from": "1", + "to": "2" }, + "cc": { "match": "message3cc" }}, + [])) + self._testFilters(filters) + # 1. test sort: (receive-date) ARRIVAL # 1. test sort: (date) DATE # 1. test sort: CC @@ -552,6 +598,5 @@ class DAVMailCollectionTest(unittest.TestCase): self._deleteCollection ("test-dav-mail") - if __name__ == "__main__": unittest.main()