-
Notifications
You must be signed in to change notification settings - Fork 0
/
simpleReceipttest.py
37 lines (24 loc) · 1.03 KB
/
simpleReceipttest.py
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
31
32
33
34
35
36
37
import unittest
import simpleReceiptPrinter
class TestSimpleReceiptPrinter(unittest.TestCase):
def setUp(self):
pass
def test_getItem(self):
test_list = ["1","lotion","on","the","skin","at","7","13"]
results = ( 1 ,["lotion","on","the","skin"], 7.13 )
self.assertEqual( simpleReceiptPrinter.getItem(test_list), results )
def test_isImported(self):
temp = ["imported", "bottle", "of", "chartruse"]
self.assertEqual( simpleReceiptPrinter.isImported(temp), True)
def test_isExempt(self):
temp = ["engineering", "ethics", "book"]
self.assertEqual( simpleReceiptPrinter.isSalesExempt(temp), True)
def test_isNotExempt(self):
temp = ["Justin", "Beiber", "CD"]
self.assertEqual( simpleReceiptPrinter.isImported(temp), False)
def test_RoundSalesTax(self):
self.assertEqual( simpleReceiptPrinter.roundSalesTax(3.01), 3.05)
def test_RoundSalesTax2(self):
self.assertEqual( simpleReceiptPrinter.roundSalesTax(7.35), 7.35)
if __name__ == '__main__':
unittest.main()