Procházet zdrojové kódy

try to fix flaky test_auto_serving_file_from_video_source

Rodja Trappe před 1 rokem
rodič
revize
69fed11674
1 změnil soubory, kde provedl 6 přidání a 5 odebrání
  1. 6 5
      tests/test_serving_files.py

+ 6 - 5
tests/test_serving_files.py

@@ -30,12 +30,13 @@ def assert_video_file_streaming(path: str) -> None:
         r = http_client.get(
             path if 'http' in path else f'http://localhost:{Screen.PORT}{path}',
             headers={'Range': 'bytes=0-1000'},
+            timeout=1,
         )
-        assert r.status_code == 206
-        assert r.headers['Accept-Ranges'] == 'bytes'
-        assert r.headers['Content-Range'].startswith('bytes 0-1000/')
-        assert r.headers['Content-Length'] == '1001'
-        assert r.headers['Content-Type'] == 'video/mp4'
+    assert r.status_code == 206
+    assert r.headers['Accept-Ranges'] == 'bytes'
+    assert r.headers['Content-Range'].startswith('bytes 0-1000/')
+    assert r.headers['Content-Length'] == '1001'
+    assert r.headers['Content-Type'] == 'video/mp4'
 
 
 def test_media_files_can_be_streamed(screen: Screen):