def test_find_words_using_and_fail(self): parser = logfind.return_parser() parsed_arguments = parser.parse_args(self.arguments_and) assert_false(logfind.find_words(parsed_arguments, b"this is a "))
def test_find_words_using_or(self): parser = logfind.return_parser() parsed_arguments = parser.parse_args(self.arguments_or) assert_true(logfind.find_words(parsed_arguments, b"this is a test"))
def test_find_words_using_or_fail(self): parser = logfind.return_parser() parsed_arguments = parser.parse_args(self.arguments_or) assert_false(logfind.find_words(parsed_arguments, b"blah blah blah"))
def test_return_parsar(self): parser = logfind.return_parser() with assert_raises(SystemExit): parser.parse_args() parser.parse_args(["-o"])