summaryrefslogtreecommitdiff
path: root/service/test/search/test_search_query.py
diff options
context:
space:
mode:
authorBruno Wagner Goncalves <bwagner@thoughtworks.com>2014-08-07 16:23:40 -0300
committerBruno Wagner Goncalves <bwagner@thoughtworks.com>2014-08-07 16:23:40 -0300
commit719240d19bfcf5488a99d38cacccdbbeb94e30f8 (patch)
treee5483ac61d4de59d092092e221befb3ba816b56a /service/test/search/test_search_query.py
parent579dafc737ef4a3af98cede0af72bb492ca8a944 (diff)
#2 - +@shyba +@bwagner +@neissi - fixed search with quotes bug
Diffstat (limited to 'service/test/search/test_search_query.py')
-rw-r--r--service/test/search/test_search_query.py33
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"])