Design Architecture for Utility Functions (iss-1ac610bafd4c)
Some checks are pending
ci / test (push) Waiting to run
Some checks are pending
ci / test (push) Waiting to run
This commit is contained in:
parent
4c157b9c4e
commit
37136d73d3
1 changed files with 22 additions and 0 deletions
22
tests/test_math_utils.py
Normal file
22
tests/test_math_utils.py
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
import unittest
|
||||
from utils.math_utils import add, subtract, multiply, divide
|
||||
|
||||
|
||||
class TestMathUtils(unittest.TestCase):
|
||||
def test_add(self):
|
||||
self.assertEqual(add(1, 2), 3)
|
||||
|
||||
def test_subtract(self):
|
||||
self.assertEqual(subtract(5, 3), 2)
|
||||
|
||||
def test_multiply(self):
|
||||
self.assertEqual(multiply(3, 4), 12)
|
||||
|
||||
def test_divide(self):
|
||||
self.assertEqual(divide(10, 2), 5)
|
||||
with self.assertRaises(ValueError):
|
||||
divide(10, 0)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
Loading…
Add table
Add a link
Reference in a new issue