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"' )
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"' )
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!"' )
def test3(): assert(string_times('Hi', 0)) == ""
def test2(): assert(string_times('Hi',3)) == "HiHiHi"
def test1(): assert(string_times('Hi',2)) == "HiHi"
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 ""')
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"')
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 ""')