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))
Ejemplo n.º 5
0
 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')
Ejemplo n.º 6
0
 def test_single_character_case(self):
     '''
 test a string with only one character
 '''
     word = 'a'
     self.assertEqual(first_non_repeat(word), 'a')
Ejemplo n.º 7
0
 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')
Ejemplo n.º 8
0
 def test_false_case(self):
     '''
 test a case where a word has no non-repeated characters
 '''
     word = 'papa'
     self.assertFalse(first_non_repeat(word))