diff --git a/calculator/calculator.py b/calculator/calculator.py index 7f593f2..ca17216 100644 --- a/calculator/calculator.py +++ b/calculator/calculator.py @@ -4,4 +4,8 @@ def add(x,y): def subtract(x,y): """Subtract one number from another.""" - return x - y \ No newline at end of file + return x - y + +def multiply(x,y): + """Multiply two numbers.""" + return x * y \ No newline at end of file diff --git a/tests/test_calculator.py b/tests/test_calculator.py index 819b962..fc101ca 100644 --- a/tests/test_calculator.py +++ b/tests/test_calculator.py @@ -1,5 +1,5 @@ import unittest -from calculator.calculator import add, subtract +from calculator.calculator import add, subtract, multiply class TestCalculator(unittest.TestCase): @@ -9,5 +9,8 @@ def test_add(self): def test_subtract(self): self.assertEqual(subtract(5, 3), 2) + def test_multiply(self): + self.assertEqual(multiply(3, 4), 12) + if __name__=='__main__': unittest.main() \ No newline at end of file