コード例 #1
0
ファイル: test_asst.py プロジェクト: ProjectAT/uam
    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\'.')
コード例 #2
0
ファイル: test_asst.py プロジェクト: ProjectAT/uam
    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\'.')
コード例 #3
0
ファイル: test_asst.py プロジェクト: ProjectAT/uam
    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.')