added adjustment test
This commit is contained in:
parent
9f01b9a089
commit
779f74e825
@ -41,3 +41,14 @@ class TestOrchestrator(unittest.TestCase):
|
|||||||
target_vel = self.orc._compute_velocity(tl_geo, current_vel)
|
target_vel = self.orc._compute_velocity(tl_geo, current_vel)
|
||||||
self.assertNotEqual(current_vel, target_vel)
|
self.assertNotEqual(current_vel, target_vel)
|
||||||
self.assertEqual(0, target_vel)
|
self.assertEqual(0, target_vel)
|
||||||
|
|
||||||
|
def test_adjust_speed_to_get_over_on_green_if_currently_red(self):
|
||||||
|
self.orc.tls = {'1': {'color': TrafficLightColor.RED, 'switching_time': 100, 'last_switch': self.timestamp}}
|
||||||
|
tl_geo = {'cursor': [
|
||||||
|
{'id': '1', 'calculatedRange': 1000}
|
||||||
|
]}
|
||||||
|
current_vel = 130.0
|
||||||
|
|
||||||
|
target_vel = self.orc._compute_velocity(tl_geo, current_vel)
|
||||||
|
self.assertNotEqual(current_vel, target_vel)
|
||||||
|
self.assertEqual(36.0, target_vel)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user