-
Notifications
You must be signed in to change notification settings - Fork 369
Expand file tree
/
Copy pathvehicle_info_test.py
More file actions
41 lines (30 loc) · 1.31 KB
/
vehicle_info_test.py
File metadata and controls
41 lines (30 loc) · 1.31 KB
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
38
39
40
41
import unittest
from vehicle_info_after import VehicleInfo
class TestVehicleInfoMethods(unittest.TestCase):
pass
# def test_compute_tax_non_electric(self):
# v = VehicleInfo("BMW", False, 10000)
# self.assertEqual(v.compute_tax(), 500)
# def test_compute_tax_electric(self):
# v = VehicleInfo("BMW", True, 10000)
# self.assertEqual(v.compute_tax(), 200)
# def test_compute_tax_exemption(self):
# v = VehicleInfo("BMW", False, 10000)
# self.assertEqual(v.compute_tax(5000), 250)
# def test_compute_tax_exemption_negative(self):
# v = VehicleInfo("BMW", False, 10000)
# self.assertRaises(ValueError, v.compute_tax, -5000)
# def test_compute_tax_exemption_high(self):
# v = VehicleInfo("BMW", False, 10000)
# self.assertEqual(v.compute_tax(20000), 0)
# def test_can_lease_false(self):
# v = VehicleInfo("BMW", False, 10000)
# self.assertEqual(v.can_lease(5000), False)
# def test_can_lease_true(self):
# v = VehicleInfo("BMW", False, 10000)
# self.assertEqual(v.can_lease(15000), True)
# def test_can_lease_negative_income(self):
# v = VehicleInfo("BMW", False, 10000)
# self.assertRaises(ValueError, v.can_lease, -5000)
# run the actual unittests
unittest.main()