Example #1
0
 def test_code_and_3_returns_codecodecode(self):
     actual = string_times("code", 3)
     expected = "codecodecode"
     self.assertEqual(
         actual, expected,
         'Expected calling string_times() with "code" and "3" to equal "codecodecode"'
     )
Example #2
0
 def test_hi_and_2_returns_hihi(self):
     actual = string_times("Hi", 2)
     expected = "HiHi"
     self.assertEqual(
         actual, expected,
         'Expected calling string_times() with "Hi" and "2" to equal "HiHi"'
     )
Example #3
0
 def test_oh_boy_and_2_returns_ohboyohboy(self):
     actual = string_times("Oh Boy!", 2)
     expected = "Oh Boy!Oh Boy!"
     self.assertEqual(
         actual, expected,
         'Expected calling string_times() with "Oh Boy!" and "2" to equal "Oh Boy!Oh Boy!"'
     )
Example #4
0
def test3():
    assert(string_times('Hi', 0)) == ""
Example #5
0
def test2():
    assert(string_times('Hi',3)) == "HiHiHi" 
Example #6
0
def test1():
    assert(string_times('Hi',2)) == "HiHi"
Example #7
0
 def test_blank_and_4_returns_blank(self):
     actual = string_times("", 4)
     expected = ""
     self.assertEqual(
         actual, expected,
         'Expected calling string_times() with "" and "4" to equal ""')
Example #8
0
 def test_x_and_4_returns_xxxx(self):
     actual = string_times("x", 4)
     expected = "xxxx"
     self.assertEqual(
         actual, expected,
         'Expected calling string_times() with "x" and "4" to equal "xxxx"')
Example #9
0
 def test_hi_and_0_returns_blank(self):
     actual = string_times("Hi", 0)
     expected = ""
     self.assertEqual(
         actual, expected,
         'Expected calling string_times() with "Hi" and "0" to equal ""')