Fix endpoint

This commit is contained in:
Rui Alves 2024-09-21 16:12:09 +01:00
parent 2dce0448f6
commit fcb54adb5f
2 changed files with 2 additions and 1 deletions

View File

@ -65,7 +65,7 @@ def go2rtc_streams():
return JSONResponse(content=stream_data) return JSONResponse(content=stream_data)
@router.get("/go2rtc/streams/<camera_name>") @router.get("/go2rtc/streams/{camera_name}")
def go2rtc_camera_stream(camera_name: str): def go2rtc_camera_stream(camera_name: str):
r = requests.get( r = requests.get(
f"http://127.0.0.1:1984/api/streams?src={camera_name}&video=all&audio=all&microphone" f"http://127.0.0.1:1984/api/streams?src={camera_name}&video=all&audio=all&microphone"

View File

@ -130,6 +130,7 @@ class TestHttp(unittest.TestCase):
with TestClient(app) as client: with TestClient(app) as client:
_insert_mock_event(id) _insert_mock_event(id)
# TODO: Rui. All the tests are now broken since there's no .json in the FastAPI client.get/post requests
events = client.get("/events").json events = client.get("/events").json
assert events assert events
assert len(events) == 1 assert len(events) == 1