|
16 | 16 | from go2rtc_client.rest import ( |
17 | 17 | _API_PREFIX, |
18 | 18 | _ApplicationClient, |
| 19 | + _SchemesClient, |
19 | 20 | _StreamClient, |
20 | 21 | _WebRTCClient, |
21 | 22 | ) |
@@ -134,16 +135,17 @@ async def test_streams_add_str( |
134 | 135 | ) |
135 | 136 |
|
136 | 137 |
|
137 | | -VERSION_ERR = "server version '{}' not >= 1.9.5 and < 2.0.0" |
| 138 | +VERSION_ERR = "server version '{}' not >= 1.9.12 and < 2.0.0" |
138 | 139 |
|
139 | 140 |
|
140 | 141 | @pytest.mark.parametrize( |
141 | 142 | ("server_version", "expected_result"), |
142 | 143 | [ |
143 | 144 | ("0.0.0", pytest.raises(Go2RtcVersionError, match=VERSION_ERR.format("0.0.0"))), |
144 | | - ("1.9.4", pytest.raises(Go2RtcVersionError, match=VERSION_ERR.format("1.9.4"))), |
145 | | - ("1.9.5", does_not_raise()), |
146 | | - ("1.9.6", does_not_raise()), |
| 145 | + ("1.9.5", pytest.raises(Go2RtcVersionError, match=VERSION_ERR.format("1.9.5"))), |
| 146 | + ("1.9.6", pytest.raises(Go2RtcVersionError, match=VERSION_ERR.format("1.9.6"))), |
| 147 | + ("1.9.12", does_not_raise()), |
| 148 | + ("1.9.13", does_not_raise()), |
147 | 149 | ("2.0.0", pytest.raises(Go2RtcVersionError, match=VERSION_ERR.format("2.0.0"))), |
148 | 150 | ("BLAH", pytest.raises(Go2RtcVersionError, match=VERSION_ERR.format("BLAH"))), |
149 | 151 | ], |
@@ -220,3 +222,18 @@ async def test_get_jpeg_snapshot( |
220 | 222 | assert isinstance(resp, bytes) |
221 | 223 |
|
222 | 224 | assert resp == image_bytes |
| 225 | + |
| 226 | + |
| 227 | +async def test_schemes( |
| 228 | + responses: aioresponses, |
| 229 | + rest_client: Go2RtcRestClient, |
| 230 | + snapshot: SnapshotAssertion, |
| 231 | +) -> None: |
| 232 | + """Test schemes.""" |
| 233 | + responses.get( |
| 234 | + f"{URL}{_SchemesClient.PATH}", |
| 235 | + status=200, |
| 236 | + body=json.dumps(["webrtc", "exec", "ffmpeg", "rtsp", "rtsps", "rtspx"]), |
| 237 | + ) |
| 238 | + resp = await rest_client.schemes.list() |
| 239 | + assert resp == snapshot |
0 commit comments