Add filtering to gallery

This commit is contained in:
Julian Stirling 2026-06-24 10:34:09 +01:00
parent e1e8cef8af
commit a5828fbf41
6 changed files with 52 additions and 37 deletions

View file

@ -42,8 +42,6 @@ class MinimalGalleryClass:
This should fail the protocol check as it is not an OFMThing
"""
gallery_data_name: str = "Mock"
gallery_data_schema: type[BaseModel] = MockGalleryData
def get_data_for_gallery(self) -> list[BaseModel]:
@ -66,13 +64,11 @@ class MinimalGallerySource(OFMThing, MinimalGalleryClass):
class BadGallerySource(OFMThing):
"""An OFMThing that almost defines enough to show in the gallery.
Shouldn't match the protocol as ``gallery_data_name`` is missing.
Shouldn't match the protocol as ``gallery_data_schema`` is missing.
"""
show_data_in_gallery = True
gallery_data_schema: type[BaseModel] = MockGalleryData
def get_data_for_gallery(self) -> list[BaseModel]:
"""Return a list of Mock Gallery Data."""
return [MockGalleryData(mock="mock", foobar="foobar")]

View file

@ -297,7 +297,6 @@ def test_gallery_responses(camera, mocker, caplog):
with tempfile.TemporaryDirectory() as tmpdir, caplog.at_level(logging.INFO):
camera._data_dir = tmpdir
assert camera.gallery_data_name == "Captures"
assert camera.gallery_data_schema == CaptureInfo
# When we start there are no captures