diff --git a/components/orchestration/test_orchestrator.py b/components/orchestration/test_orchestrator.py index 5ad4af5..50ad708 100644 --- a/components/orchestration/test_orchestrator.py +++ b/components/orchestration/test_orchestrator.py @@ -41,3 +41,14 @@ class TestOrchestrator(unittest.TestCase): target_vel = self.orc._compute_velocity(tl_geo, current_vel) self.assertNotEqual(current_vel, 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)