Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion go2rtc_client/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def __pre_deserialize__(cls, d: dict[Any, Any]) -> dict[Any, Any]:
class Producer:
"""Producer model."""

url: str
url: str | None = None


@dataclass
Expand Down
11 changes: 11 additions & 0 deletions tests/__snapshots__/test_rest.ambr
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,17 @@
}),
})
# ---
# name: test_streams_get[whip producer without url]
dict({
'camera.kiosk_tablet': dict({
'producers': list([
dict({
'url': None,
}),
]),
}),
})
# ---
# name: test_streams_get[without producers]
dict({
'camera.12mp_fluent': dict({
Expand Down
34 changes: 34 additions & 0 deletions tests/fixtures/streams_whip_producer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"camera.kiosk_tablet": {
"producers": [
{
"id": 4439,
"format_name": "webrtc",
"protocol": "http+udp",
"remote_addr": "192.168.10.212:59793 host",
"user_agent": "Mozilla/5.0 (Linux; Android 8.1.0; Lenovo StarView Build/OPM7.181205.001; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/138.0.7204.181 Safari/537.36",
"medias": [
"video, recvonly, H264",
"video, sendonly, VP8, VP9, H264"
],
"receivers": [
{
"id": 4440,
"codec": {
"codec_name": "h264",
"codec_type": "video"
},
"childs": [
4447,
4456
],
"bytes": 37630084,
"packets": 34687
}
],
"bytes_recv": 38330115
}
],
"consumers": []
}
}
8 changes: 7 additions & 1 deletion tests/test_rest.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,17 @@ async def test_application_info(

@pytest.mark.parametrize(
"filename",
["streams_one.json", "streams_none.json", "streams_without_producers.json"],
[
"streams_one.json",
"streams_none.json",
"streams_without_producers.json",
"streams_whip_producer.json",
],
ids=[
"one stream",
"empty",
"without producers",
"whip producer without url",
],
)
async def test_streams_get(
Expand Down