def test__exec_simple_search__term_not_in_file__return_empty(self): # Arrange path = self.txt_path content = self.txt_content term = "not-found" # Act result = FileInspector.exec_simple_search(path, content, term) # Assert self.assertEqual(list, type(result)) self.assertEqual(0, len(result))
def test__exec_simple_search__term_has_line_break__return_file(self): # Arrange path = self.txt_path content = self.txt_content term = "elitr,\nsed" # Act result = FileInspector.exec_simple_search(path, content, term) # Assert self.assertEqual(list, type(result)) self.assertEqual(1, len(result))
def test__exec_simple_search__term_in_file__return_file(self): # Arrange path = self.txt_path content = self.txt_content term = "sed" # Act result = FileInspector.exec_simple_search(path, content, term) # Assert self.assertEqual(list, type(result)) self.assertEqual(1, len(result)) self.assertEqual(path, result[0].file) self.assertEqual(term, result[0].term) self.assertIsNone(result[0].line_number)