-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.py
More file actions
28 lines (23 loc) · 682 Bytes
/
test.py
File metadata and controls
28 lines (23 loc) · 682 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# test.py
import pytest
from Suma import adder
from sustraction import sustraction
from Multiplier import multiplier
from dividedanger import dividedanger
def test_adder():
assert adder(1, 2) == 3
assert adder(-1, 1) == 0
assert adder(-1, -1) == -2
def test_sustraction():
assert sustraction(10, 5) == 5
assert sustraction(0, 0) == 0
assert sustraction(-5, -5) == 0
def test_multiplier():
assert multiplier(3, 4) == 12
assert multiplier(-1, 1) == -1
assert multiplier(0, 10) == 0
def test_dividedanger():
assert dividedanger(10, 2) == 5
assert dividedanger(-6, 3) == -2
with pytest.raises(ValueError):
dividedanger(1, 0)