import unittest import io import re from unittest import mock import math import student_X as main #Replace student_X with your filename class SphereVolumeTests(unittest.TestCase): def test_default_case(self): function = main.sphere_volume try: docstring = function.__doc__ docstring = docstring.strip() except: docstring = "" correct = docstring != "" message = "No docstring." self.assertTrue(correct, message) test = False try: correct = 4/3 * math.pi * 132 ** 3 result = function(132) test = correct == result except: pass message = "Doesn't return the correct volume on a bigger sphere." self.assertTrue(test, message) test = False try: correct = 4/3 * math.pi * .4 ** 3 result = function(.4) test = correct == result except: pass message = "Doesn't return the correct volume on a smaller sphere." self.assertTrue(test, message) if __name__ == "__main__": tests = SphereVolumeTests() tests.test_default_case()