Repository navigation
Expand file tree
/
Copy pathtest_oop1.py
More file actions
44 lines (35 loc) · 1.46 KB
/
Copy pathtest_oop1.py
File metadata and controls
44 lines (35 loc) · 1.46 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
42
43
44
import unittest
from oop1 import *
class Oop1Tests(unittest.TestCase):
def setUp(self):
self.vehicle = Vehicle()
self.flight_vehicle = FlightVehicle()
self.ground_vehicle = GroundVehicle()
self.car = Car()
self.motorcycle = Motorcycle()
self.starship = Starship()
self.airplane = Airplane()
def test_flight_vehicle(self):
self.assertTrue(isinstance(self.flight_vehicle, FlightVehicle))
self.assertTrue(isinstance(self.flight_vehicle, Vehicle))
def test_ground_vehicle(self):
self.assertTrue(isinstance(self.ground_vehicle, GroundVehicle))
self.assertTrue(isinstance(self.ground_vehicle, Vehicle))
def test_starship(self):
self.assertTrue(isinstance(self.starship, Starship))
self.assertTrue(isinstance(self.starship, FlightVehicle))
self.assertTrue(isinstance(self.starship, Vehicle))
def test_airplane(self):
self.assertTrue(isinstance(self.airplane, Airplane))
self.assertTrue(isinstance(self.airplane, FlightVehicle))
self.assertTrue(isinstance(self.starship, Vehicle))
def test_car(self):
self.assertTrue(isinstance(self.car, Car))
self.assertTrue(isinstance(self.car, GroundVehicle))
self.assertTrue(isinstance(self.car, Vehicle))
def test_motocycle(self):
self.assertTrue(isinstance(self.motorcycle, Motorcycle))
self.assertTrue(isinstance(self.motorcycle, GroundVehicle))
self.assertTrue(isinstance(self.motorcycle, Vehicle))
if __name__ == '__main__':
unittest.main()