Add filtering to gallery
This commit is contained in:
parent
e1e8cef8af
commit
a5828fbf41
6 changed files with 52 additions and 37 deletions
|
|
@ -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")]
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue