def test_multiply_string_05(): # random for _ in range(100): input_string = "".join( random.choices(string.printable, k=random.randint(1, 10))) multiplier = random.randint(0, 20) assert exam.multiply_string(input_string, multiplier) == input_string * multiplier
def test_multiply_string_04(): # zero assert exam.multiply_string("a", 0) == "" assert exam.multiply_string("a b c d", 0) == "" assert exam.multiply_string("", 0) == ""
def test_multiply_string_02(): # diff chars assert exam.multiply_string("a b", 3) == "a ba ba b" assert exam.multiply_string("a ", 3) == "a a a " assert exam.multiply_string(" ab", 3) == " ab ab ab" assert exam.multiply_string("!2# aG ", 4) == "!2# aG !2# aG !2# aG !2# aG "
def test_multiply_string_03(): # empty string assert exam.multiply_string("", 1) == "" assert exam.multiply_string("", 3) == ""
def test_multiply_string_01(): # easy assert exam.multiply_string("ab", 1) == "ab" assert exam.multiply_string("ab", 2) == "abab" assert exam.multiply_string("A", 3) == "AAA"