Skip to content

Commit fb4031d

Browse files
author
ns loni
committed
added thetest cases
1 parent 14898d7 commit fb4031d

File tree

5 files changed

+20
-0
lines changed

5 files changed

+20
-0
lines changed

requirements.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
pandas
2+
pytest

src/__init__.py

Whitespace-only changes.

src/math_operation.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
def add(a,b):
2+
return a+b
3+
4+
def sub(a,b):
5+
return a-b

tests/__init__.py

Whitespace-only changes.

tests/test_operation.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
from src.math_operation import add, sub
2+
3+
def test_add():
4+
assert add(2,3) == 5
5+
assert add(-1, 1) == 0
6+
assert sub(5,3) == 2
7+
8+
def test_sub():
9+
assert sub(5,3) == 2
10+
assert sub(4,3) == 1
11+
assert sub(3,3) == 0
12+
assert sub(2,3) == -1
13+

0 commit comments

Comments
 (0)