def test_simple_case(self): ''' test a simple case of a word with a first non repeat char ''' word = 'total' self.assertEqual(first_non_repeat(word), 'o')
def test_tail_case(self): ''' test a case where the first repeated character is the very last one ''' word = 'pappas' self.assertEqual(first_non_repeat(word), 's')
def test_single_character_case(self): ''' test a string with only one character ''' word = 'a' self.assertEqual(first_non_repeat(word), 'a')
def test_false_case(self): ''' test a case where a word has no non-repeated characters ''' word = 'papa' self.assertFalse(first_non_repeat(word))