Skip to content

Commit

Permalink
Merge pull request #3 from michaelkawaicheung/feature/multiply
Browse files Browse the repository at this point in the history
Feature/multiply
  • Loading branch information
michaelkawaicheung authored Aug 16, 2024
2 parents a136332 + 9dc860a commit 77a40a8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
6 changes: 5 additions & 1 deletion calculator/calculator.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,8 @@ def add(x,y):

def subtract(x,y):
"""Subtract one number from another."""
return x - y
return x - y

def multiply(x,y):
"""Multiply two numbers."""
return x * y
5 changes: 4 additions & 1 deletion tests/test_calculator.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import unittest
from calculator.calculator import add, subtract
from calculator.calculator import add, subtract, multiply

class TestCalculator(unittest.TestCase):

Expand All @@ -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()

0 comments on commit 77a40a8

Please sign in to comment.