forked from dhananjay-arora/PythonDashTest
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTestInvoice.py
More file actions
30 lines (20 loc) · 765 Bytes
/
TestInvoice.py
File metadata and controls
30 lines (20 loc) · 765 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
29
30
import pytest
from Invoice import Invoice
@pytest.fixture()
def products():
products = {"Pen": {'qnt': 10, 'unit_price': 3.75, 'discount': 5},
"Notebook": {'qnt': 5, 'unit_price': 7.5, 'discount': 10}}
return products
@pytest.fixture()
def invoice():
invoice = Invoice()
return invoice
def test_CanCalculateTotalImpurePrice(invoice, products):
invoice.totalImpurePrice(products)
assert invoice.totalImpurePrice(products) == 75
def test_CanCalculateTotalDiscount(invoice, products):
invoice.totalDiscount(products)
assert invoice.totalDiscount(products) == 5.62
def test_CanCalculateTotalPurePrice(invoice, products):
invoice.totalPurePrice(products)
assert invoice.totalPurePrice(products) == 69.38