import unittest import io import re from unittest import mock import math import student_X as main #Replace student_X with your filename class RepeatStringTests(unittest.TestCase): def test_default_case(self): function = main.repeat_string test = False try: incorrect = "" result = function.__doc__.strip() test = incorrect != result except: pass self.assertTrue(test, "No docstring!") inputs = ("monkey", 0) test = False try: correct = "" result = function(*inputs) test = correct == result except: pass self.assertTrue(test, "Doesn't return the empty string when asked to repeat the string 'monkey' zero times.") inputs = ("monkey", 25) test = False try: correct = "monkey" * 25 result = function(*inputs) test = correct == result except: pass self.assertTrue(test, "Doesn't repeat the string 'monkey' a bunch of times.") if __name__ == "__main__": tests = RepeatStringTests() tests.test_default_case()