Exemplo n.º 1
0
 def test_invalid_query(self):
     ex = None
     try:
         btsearch.parse_query("func func")
     except SyntaxError, e:
         ex = e
         pass
Exemplo n.º 2
0
 def test_extra_spaces(self):
     q = btsearch.parse_query(" func    AND func1 OR      func2   ")
     self.assertEqual(q, ["func", "AND", "func1", "OR", "func2"])
Exemplo n.º 3
0
 def test_case_insensitive(self):
     q = btsearch.parse_query("func and func1")
     self.assertEqual(q, ["func", "AND", "func1"])
Exemplo n.º 4
0
 def test_multiple(self):
     q = btsearch.parse_query("func AND func1 OR func2")
     self.assertEqual(q, ["func", "AND", "func1", "OR", "func2"])
Exemplo n.º 5
0
 def test_and(self):
     q = btsearch.parse_query("func AND func1")
     self.assertEqual(q, ["func", "AND", "func1"])
Exemplo n.º 6
0
 def test_or(self):
     q = btsearch.parse_query("func OR func1")
     self.assertEqual(q, ["func", "OR", "func1"])
Exemplo n.º 7
0
 def test_single(self):
     q = btsearch.parse_query("func")
     self.assertEqual(len(q), 1)