diff options
Diffstat (limited to 'service/test/search/test_search_query.py')
-rw-r--r-- | service/test/search/test_search_query.py | 33 |
1 files changed, 18 insertions, 15 deletions
diff --git a/service/test/search/test_search_query.py b/service/test/search/test_search_query.py index a5f3be99..c81b9ba1 100644 --- a/service/test/search/test_search_query.py +++ b/service/test/search/test_search_query.py @@ -1,21 +1,24 @@ -import sys, os - +import sys +import os +import unittest from app.search import SearchQuery -def test_one_tag(): - assert SearchQuery.compile(u"in:inbox")["tags"] == ["inbox"] - assert SearchQuery.compile(u"in:trash")["tags"] == ["trash"] - -def test_two_tags_or(): - assert SearchQuery.compile(u"in:inbox or in:trash")["tags"] == ["inbox", "trash"] +class SearchTestCase(unittest.TestCase): + + def test_one_tag(self): + self.assertEquals(SearchQuery.compile(u"in:inbox")["tags"], ["inbox"]) + self.assertEquals(SearchQuery.compile(u"in:trash")["tags"], ["trash"]) + + def test_two_tags_or(self): + self.assertEquals(SearchQuery.compile(u"in:inbox or in:trash")["tags"], ["inbox", "trash"]) - -def test_tag_negate(): - assert SearchQuery.compile(u"-in:trash")["not_tags"] == ["trash"] + def test_tag_negate(self): + self.assertEquals(SearchQuery.compile(u"-in:trash")["not_tags"], ["trash"]) -def test_general_search(): - assert SearchQuery.compile(u"searching")["general"] == "searching" + def test_general_search(self): + self.assertEquals(SearchQuery.compile(u"searching")["general"], "searching") -def test_tags_with_quotes(): - assert SearchQuery.compile(u"in:\"inbox\"")["tags"] == ["inbox"] + def test_tags_with_quotes(self): + self.assertEquals(SearchQuery.compile(u"in:\"inbox\"")["tags"], ["inbox"]) + self.assertEquals(SearchQuery.compile(u"in:'inbox'")["tags"], ["inbox"]) |