Example #1
0
 def test_file_with_overlaping_and_equal_length_viruses(self):
     input_file = 'aba'
     viruses = ['ab', 'ba']
     self.assertEqual(['ab'], norton(input_file, viruses))
Example #2
0
 def test_empty_file(self):
     input_file = ''
     viruses = ['a', 'aa']
     self.assertEqual([], norton(input_file, viruses))
Example #3
0
 def test_file_abcab_with_2_viruses(self):
     input_file = 'abcab'
     viruses = ['a', 'ab']
     self.assertEqual(['ab', 'ab'], norton(input_file, viruses))
Example #4
0
 def test_file_with_a_2_chars_virus(self):
     input_file = 'aba'
     viruses = ['ab']
     self.assertEqual(['ab'], norton(input_file, viruses))
Example #5
0
 def test_file_with_2_overlaping_viruses(self):  # FDP
     input_file = 'abc'
     viruses = ['a', 'ab']
     self.assertEqual(['ab'], norton(input_file, viruses))
Example #6
0
 def test_file_with_2_virus_1_found_twice(self):
     input_file = 'aba'
     viruses = ['a', 'b']
     self.assertEqual(['a', 'b', 'a'], norton(input_file, viruses))
Example #7
0
 def test_file_with_2_different_virus(self):
     input_file = 'abc'
     viruses = ['a', 'b']
     self.assertEqual(['a', 'b'], norton(input_file, viruses))
Example #8
0
 def test_file_with_second_virus_inside(self):
     input_file = 'ab'
     viruses = ['c', 'a']
     self.assertEqual(['a'], norton(input_file, viruses))
Example #9
0
 def test_clean_file(self):
     input_file = 'b'
     viruses = ['a']
     self.assertEqual([], norton(input_file, viruses))
Example #10
0
 def test_one_virus(self):
     input_file = 'a'
     viruses = ['a']
     self.assertEqual(['a'], norton(input_file, viruses))