Skip to content

Commit

Permalink
write a test
Browse files Browse the repository at this point in the history
  • Loading branch information
ytliuSVN committed Oct 28, 2024
1 parent 3aa5e73 commit c9dd337
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
6 changes: 6 additions & 0 deletions app/app/calc.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
"""
Calculator functions
"""

def add(x, y):
return x + y
14 changes: 14 additions & 0 deletions app/app/tests.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
"""
Sample tests
"""

from django.test import SimpleTestCase

from app import calc

class CalcTests(SimpleTestCase):

def test_add_numbers(self):
res = calc.add(5, 6)

self.assertEqual(res, 11)

0 comments on commit c9dd337

Please sign in to comment.