Mercurial > libervia-backend
diff tests/unit/frontends/test_webrtc.py @ 4285:f1d0cde61af7
tests (unit): fix tests + black reformatting.
author | Goffi <goffi@goffi.org> |
---|---|
date | Sun, 14 Jul 2024 17:42:53 +0200 |
parents | 0fbe5c605eb6 |
children |
line wrap: on
line diff
--- a/tests/unit/frontends/test_webrtc.py Sun Jul 14 16:47:45 2024 +0200 +++ b/tests/unit/frontends/test_webrtc.py Sun Jul 14 17:42:53 2024 +0200 @@ -29,7 +29,6 @@ from libervia.frontends.tools import webrtc as webrtc_mod - @pytest.fixture def host(monkeypatch): host = MagicMock() @@ -37,6 +36,7 @@ host.app.expand = lambda s: s return host + @pytest.fixture(scope="function") def webrtc(host): """Fixture for WebRTC instantiation.""" @@ -185,7 +185,7 @@ async def test_setup_call_test_mode(self, host, webrtc, monkeypatch): """Test mode use fake video and audio in setup_call.""" monkeypatch.setattr(data_format, "deserialise", MagicMock(return_value=[])) - monkeypatch.setattr(webrtc, "sources", webrtc_mod.SINKS_TEST) + monkeypatch.setattr(webrtc, "sources_data", webrtc_mod.SourcesTest()) await webrtc.setup_call("initiator") assert "videotestsrc" in webrtc.gst_pipe_desc assert "audiotestsrc" in webrtc.gst_pipe_desc @@ -194,7 +194,7 @@ async def test_setup_call_normal_mode(self, host, webrtc, monkeypatch): """Normal mode use real video and audio in setup_call.""" monkeypatch.setattr(data_format, "deserialise", MagicMock(return_value=[])) - monkeypatch.setattr(webrtc, "sources", webrtc_mod.SOURCES_AUTO) + monkeypatch.setattr(webrtc, "sources_data", webrtc_mod.SourcesAuto()) await webrtc.setup_call("initiator") assert "v4l2src" in webrtc.gst_pipe_desc assert "pulsesrc" in webrtc.gst_pipe_desc