mirror of
https://github.com/venomade/calculator.git
synced 2026-11-16 18:27:39 +00:00
Add calculator tests and a local quality gate
This commit is contained in:
1 parent
016ac885f7
commit
8dd5bcec50
5 files changed
+42
No files matched your search
@@ -0,0 +1,21 @@
|
||||
from calculator import add, subtract, multiply, divide
|
||||
|
||||
def test_add():
|
||||
assert add(2, 3) == 5
|
||||
|
||||
def test_divide():
|
||||
assert divide(6, 2) == 3
|
||||
|
||||
def test_subtract():
|
||||
assert subtract(5, 3) == 2
|
||||
|
||||
def test_multiply():
|
||||
assert multiply(4, 3) == 12
|
||||
|
||||
def test_divide_uneven():
|
||||
# Arrange
|
||||
a, b = 5, 2
|
||||
# Act
|
||||
result = divide(a, b)
|
||||
# Assert
|
||||
assert result == 2.5
|
||||
Reference in new issue
Block a user