From 779f74e8257520630978f39d2a567e951a9251fe Mon Sep 17 00:00:00 2001 From: Marco Zeisler Date: Fri, 18 Jun 2021 00:01:43 +0200 Subject: [PATCH] added adjustment test --- components/orchestration/test_orchestrator.py | 11 +++++++++++ 1 file changed, 11 insertions(+) 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)