Created
January 11, 2023 19:25
-
-
Save HectorTorres/12ff67c8de8368a1ebc425ec693428a5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import unittest | |
import math | |
def function_square(a): | |
return a*a | |
def function_square_root(a): | |
return math.sqrt(a) | |
def function_sum(a,b): | |
return a+a | |
class Test_function1(unittest.TestCase): | |
def test_function_square(self): | |
self.assertEquals(function_square(3),4) | |
class Test_function2(unittest.TestCase): | |
def test_function_square_root(self): | |
self.assertEquals(function_square_root(16),4) | |
def test_function_square(self): | |
self.assertEquals(function_sum(2,2),4) | |
#run the program | |
#python -m unittest test_unit_02.py |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment