Skip to content

Open-source Python library for AI browser agents, plus Browser Use Cloud: stealth browsers and a hosted agent API.

test: narrow restored file type for pyright (Base64BinaryFile); ruff format

MagMuelleraaeded1c0a5e
diff --git a/tests/ci/test_file_system_images.py b/tests/ci/test_file_system_images.py
index 4d3696afb..dfe9b63cb 100644
--- a/tests/ci/test_file_system_images.py
+++ b/tests/ci/test_file_system_images.py
@@ -7,7 +7,7 @@ from pathlib import Path
import pytest
from PIL import Image
-from browser_use.filesystem.file_system import FileSystem
+from browser_use.filesystem.file_system import Base64BinaryFile, FileSystem
class TestImageFiles:
@@ -307,7 +307,7 @@ class TestBinaryFileCreation:
original_bytes = (fs.get_dir() / 'logo.png').read_bytes()
fs2 = FileSystem.from_state(fs.get_state())
restored = fs2.get_file('logo.png')
- assert restored is not None
+ assert isinstance(restored, Base64BinaryFile)
# Content integrity, not just existence: decoded bytes must round-trip and be a real PNG
assert restored._decoded() == original_bytes
assert restored._decoded()[:8] == b'\x89PNG\r\n\x1a\n'