Esempio n. 1
0
 def test_translate_101(self):
     string1 = 'abcdcba'
     self.assertEqual(string_101.str_translate_101(string1, 'a', 'x'),
                      'xbcdcbx')
     string2 = 'hello'
     self.assertEqual(string_101.str_translate_101(string2, 'l', 'ff'),
                      'heffffo')
Esempio n. 2
0
 def test_str_translate_101_2(self):
    translated = string_101.str_translate_101("aaaa", "a", "x")
    expected = "xxxx"
    self.assertEqual(translated, expected)
Esempio n. 3
0
 def test_str_translate_101(self):
    translated = string_101.str_translate_101("abcdcba", "a", "x")
    expected = "xbcdcbx"
    self.assertEqual(translated, expected)
Esempio n. 4
0
 def test_str_translate_101(self):
     self.assertEqual(string_101.str_translate_101('Hello', 'l', 'a'), 'Heaao')
     self.assertEqual(string_101.str_translate_101('Pythen', 'e', 'o'), 'Python')  
Esempio n. 5
0
 def test_str_translate_101_2(self):
     string = string_101.str_translate_101("Sax Lover", "a", "e")
     self.assertEqual(string, "Sex Lover")
Esempio n. 6
0
 def test_str_translate_101_1(self):
     string = string_101.str_translate_101("abcdcba", "a", "x")
     self.assertEqual(string, "xbcdcbx")
Esempio n. 7
0
 def test_lower4(self):
     s = 'cccaaa'
     self.assertEqual(string_101.str_translate_101(s, 'a', 'c'), 'cccccc')
     pass
Esempio n. 8
0
 def test_lower3(self):
     s = 'and'
     self.assertEqual(string_101.str_translate_101(s, 'a', 'b'), 'bnd')
     pass