setup orchestrator test framework;
This commit is contained in:
parent
f6384e1ebd
commit
81458cda49
@ -1,3 +1,4 @@
|
|||||||
|
import datetime
|
||||||
import unittest
|
import unittest
|
||||||
from unittest.mock import patch
|
from unittest.mock import patch
|
||||||
|
|
||||||
@ -8,8 +9,16 @@ from orchestrator import Orchestrator
|
|||||||
|
|
||||||
class TestOrchestrator(unittest.TestCase):
|
class TestOrchestrator(unittest.TestCase):
|
||||||
def setUp(self) -> None:
|
def setUp(self) -> None:
|
||||||
|
self.timestamp = datetime.datetime.now()
|
||||||
with patch('requests.sessions.Session.get', MyResponse):
|
with patch('requests.sessions.Session.get', MyResponse):
|
||||||
self.orc = Orchestrator()
|
self.orc = Orchestrator()
|
||||||
|
|
||||||
def test(self):
|
def test(self):
|
||||||
...
|
self.orc.tls = {'1': {'color': 'RED', 'switching_time': 1, 'last_switch': self.timestamp}}
|
||||||
|
tl_geo = {'cursor': [
|
||||||
|
{'id': '1', 'calculatedRange': 100}
|
||||||
|
]}
|
||||||
|
current_vel = 130.0
|
||||||
|
|
||||||
|
target_vel = self.orc._compute_velocity(tl_geo, current_vel)
|
||||||
|
self.assertEqual(current_vel, target_vel)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user