def test_args_with_quoted_string(self): self.assertEquals(parser.Search(query=['"Hello, world"']).args(), ['"Hello, world"'])
def test_args_with_multiple_queries(self): self.assertEquals(parser.Search(query=['hello', 'world']).args(), ['(hello|world)'])
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)
def test_args_with_case_insensitive(self): self.assertEquals(parser.Search(query=['hello'], case=False).args(), ['-i', 'hello'])
def test_args_with_file(self): self.assertEquals(parser.Search(query=['hello'], file='.*py$').args(), ['-f', '.*py$', 'hello'])
def test_args_simple(self): self.assertEquals(parser.Search(query=['hello']).args(), ['hello'])