Example #1
0
 def test_args_with_quoted_string(self):
     self.assertEquals(
         parser.Search(query=['Hello, world']).args(), ['Hello, world'])
Example #2
0
 def test_args_with_multiple_queries(self):
     self.assertEquals(
         parser.Search(query=['hello', 'world']).args(), ['(hello|world)'])
Example #3
0
class ParseQueryTest(unittest.TestCase):
    def assertParse(self, search, query=None, file=None, case=True):
        expected = parser.Search(query=query, file=file, case=case)
        actual = parser.parse_query(search)
        self.assertEquals(expected, actual)
Example #4
0
 def test_args_with_case_insensitive(self):
     self.assertEquals(
         parser.Search(query=['hello'], case=False).args(), ['-i', 'hello'])
Example #5
0
 def test_args_with_file(self):
     self.assertEquals(
         parser.Search(query=['hello'], file='.*py$').args(),
         ['-f', '.*py$', 'hello'])
Example #6
0
 def test_args_simple(self):
     self.assertEquals(parser.Search(query=['hello']).args(), ['hello'])