Пример #1
0
 def testRepeatQuickBrown6Times(self):
     string_to_repeat = "Quick Brown"
     number_of_times_to_repeat = 6
     expected = string_to_repeat * number_of_times_to_repeat
     actual = StringUtils.repeat_string(string_to_repeat,
                                        number_of_times_to_repeat)
     self.assertEqual(expected, actual)
Пример #2
0
 def testRepeatHello5Times(self):
     string_to_repeat = "Hello"
     number_of_times_to_repeat = 5
     expected = string_to_repeat * number_of_times_to_repeat
     actual = StringUtils.repeat_string(string_to_repeat,
                                        number_of_times_to_repeat)
     self.assertEqual(expected, actual)
Пример #3
0
 def pad_right20Test(self):
     hello = "The quick"
     number_of_units_to_pad = 20
     expected = "The quick           "
     actual = StringUtils.pad_right(hello, number_of_units_to_pad)
     self.assertEqual(expected, actual)
Пример #4
0
 def pad_left10Test(self):
     hello = "hello"
     number_of_units_to_pad = 10
     expected = "     hello"
     actual = StringUtils.pad_left(hello, number_of_units_to_pad)
     self.assertEqual(expected, actual)
Пример #5
0
 def pad_right15Test(self):
     hello = ""
     number_of_units_to_pad = 15
     expected = "               "
     actual = StringUtils.pad_right(hello, number_of_units_to_pad)
     self.assertEqual(expected, actual)
Пример #6
0
 def specialCharacterStringTest1(self):
     alpha_string = "!&*("
     outcome = StringUtils.is_special_character_string(alpha_string)
     self.assertTrue(outcome)
Пример #7
0
 def specialCharacterStringTest2(self):
     alpha_string = "Over the lazy dog!"
     outcome = StringUtils.is_special_character_string(alpha_string)
     self.assertFalse(outcome)
Пример #8
0
 def alpha_stringTest1(self):
     alpha_string = "The quick brown fox jumps"
     outcome = StringUtils.is_special_character_string(alpha_string)
     self.assertFalse(outcome)
Пример #9
0
 def numericStringTest1(self):
     alpha_string = "1234"
     outcome = StringUtils.is_special_character_string(alpha_string)
     self.assertFalse(outcome)
Пример #10
0
 def alpha_stringTest2(self):
     alpha_string = "Over the lazy dog"
     outcome = StringUtils.is_numeric_string(alpha_string)
     self.assertFalse(outcome)
Пример #11
0
 def alpha_stringTest1(self):
     alpha_string = "The quick brown fox jumps"
     outcome = StringUtils.is_numeric_string(alpha_string)
     self.assertFalse(outcome)
Пример #12
0
 def numericStringTest1(self):
     alpha_string = "1234"
     outcome = StringUtils.is_alpha_string(alpha_string)
     self.assertFalse(outcome)
Пример #13
0
 def alpha_stringTest2(self):
     alpha_string = "Over the lazy dog"
     outcome = StringUtils.is_alpha_string(alpha_string)
     self.assertTrue(outcome)
Пример #14
0
 def alpha_stringTest1(self):
     alpha_string = "The quick brown fox jumps"
     outcome = StringUtils.is_alpha_string(alpha_string)
     self.assertTrue(outcome)