def test_several_matches(self): ''' Testing count_letter() with multiple occurrences. ''' self.assertEqual(asstfile.count_letter('catastrophic', 'c'), 2, 'There are 2 occurrences of \'c\' in \'catastrophic\'.')
def test_single_match(self): ''' Testing count_letter() with a single occurrence. ''' self.assertEqual(asstfile.count_letter('single', 'i'), 1, 'There is exactly a single occurrence of \'i\' in \'single\'.')
def test_empty_string(self): ''' Testing count_letter() with an empty string. ''' self.assertEqual(asstfile.count_letter('', 'x'), 0, 'Searching for anything (in this case, \'x\') in the empty string should return no matches.')