From 9f01b9a08921180cbb0565e13009075155e46b09 Mon Sep 17 00:00:00 2001 From: Marco Zeisler Date: Thu, 17 Jun 2021 23:58:19 +0200 Subject: [PATCH] adapted test cases --- components/orchestration/test_orchestrator.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/components/orchestration/test_orchestrator.py b/components/orchestration/test_orchestrator.py index 7f90374..5ad4af5 100644 --- a/components/orchestration/test_orchestrator.py +++ b/components/orchestration/test_orchestrator.py @@ -15,14 +15,13 @@ class TestOrchestrator(unittest.TestCase): self.orc = Orchestrator() def test_full_speed_if_nothing_in_range(self): - self.orc.tls = {'1': {'color': TrafficLightColor.RED, 'switching_time': 100, 'last_switch': self.timestamp}} tl_geo = {'cursor': []} current_vel = 55.0 target_vel = self.orc._compute_velocity(tl_geo, current_vel) self.assertEqual(130, target_vel) - def test_full_speed_if_far_away(self): + def test_keep_speed_if_far_away_and_green(self): self.orc.tls = {'1': {'color': TrafficLightColor.GREEN, 'switching_time': 1000, 'last_switch': self.timestamp}} tl_geo = {'cursor': [ {'id': '1', 'calculatedRange': 1000} @@ -30,9 +29,9 @@ class TestOrchestrator(unittest.TestCase): current_vel = 55.0 target_vel = self.orc._compute_velocity(tl_geo, current_vel) - self.assertEqual(130, target_vel) + self.assertEqual(current_vel, target_vel) - def test_slow_down_if_passing_not_possible(self): + def test_slow_down_if_passing_RED_not_possible(self): self.orc.tls = {'1': {'color': TrafficLightColor.RED, 'switching_time': 100000, 'last_switch': self.timestamp}} tl_geo = {'cursor': [ {'id': '1', 'calculatedRange': 1}