Add entity ident test
This commit is contained in:
parent
08ea6f14b5
commit
a344203b26
@ -0,0 +1,29 @@
|
|||||||
|
import unittest
|
||||||
|
|
||||||
|
import requests
|
||||||
|
from flask import jsonify
|
||||||
|
|
||||||
|
from components.entitiy_ident.entity_ident_service.entity_ident_server import app
|
||||||
|
|
||||||
|
|
||||||
|
class TestIdentServer(unittest.TestCase):
|
||||||
|
def setUp(self) -> None:
|
||||||
|
self.app = app.test_client()
|
||||||
|
|
||||||
|
def test_get_traffic_lights(self):
|
||||||
|
response = requests.get('http://0.0.0.0:5002/api/v1/resources/traffic_lights')
|
||||||
|
self.assertEqual(200, response.status_code)
|
||||||
|
data = response.json()['cursor']
|
||||||
|
self.assertEqual('3', data[0]['id'])
|
||||||
|
|
||||||
|
def test_get_cars(self):
|
||||||
|
response = requests.get('http://0.0.0.0:5002/api/v1/resources/cars')
|
||||||
|
self.assertEqual(200, response.status_code)
|
||||||
|
data = response.json()['cursor']
|
||||||
|
self.assertEqual('5GZCZ43D13S812716', data[0]['vin'])
|
||||||
|
|
||||||
|
def test_get_traffic_light_events(self):
|
||||||
|
response = requests.get('http://0.0.0.0:5002/api/v1/resources/traffic_light_events?id=3')
|
||||||
|
self.assertEqual(200, response.status_code)
|
||||||
|
data = response.json()['cursor']
|
||||||
|
self.assertEqual('5GZCZ43D13S812716', data[0]['vin'])
|
||||||
Loading…
x
Reference in New Issue
Block a user