Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
655dd94d5d
@ -47,9 +47,8 @@ class TestVehicle(unittest.TestCase):
|
|||||||
self.assertEqual(self.v.nce, False)
|
self.assertEqual(self.v.nce, False)
|
||||||
|
|
||||||
def test_daf_prop(self):
|
def test_daf_prop(self):
|
||||||
with patch('datetime.datetime', MyDate):
|
with patch('devices.vehicle.datetime', MyDate):
|
||||||
# noinspection PyUnresolvedReferences
|
MyDate.set_timestamp(self.timestamp)
|
||||||
datetime.datetime.set_timestamp(self.timestamp)
|
|
||||||
|
|
||||||
# test if daf object created properly
|
# test if daf object created properly
|
||||||
daf = DAF(vehicle_identification_number=self.vin,
|
daf = DAF(vehicle_identification_number=self.vin,
|
||||||
@ -60,13 +59,8 @@ class TestVehicle(unittest.TestCase):
|
|||||||
self.assertEqual(self.v.daf, daf)
|
self.assertEqual(self.v.daf, daf)
|
||||||
|
|
||||||
def test_current_location_prop(self):
|
def test_current_location_prop(self):
|
||||||
with patch('datetime.datetime', MyDate):
|
with patch('devices.vehicle.datetime', MyDate):
|
||||||
# noinspection PyUnresolvedReferences
|
MyDate.set_timestamp(self.timestamp)
|
||||||
datetime.datetime.set_timestamp(self.timestamp)
|
|
||||||
|
|
||||||
# assert timestamp mocking worked
|
|
||||||
self.assertEqual(type(datetime.datetime), type(MyDate))
|
|
||||||
self.assertEqual(self.timestamp, datetime.datetime.now())
|
|
||||||
|
|
||||||
# initial position should be starting point
|
# initial position should be starting point
|
||||||
self.assertEqual(self.v.gps_location, self.starting_point)
|
self.assertEqual(self.v.gps_location, self.starting_point)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user