Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
ugyballoons committed Sep 26, 2024
1 parent 2c07826 commit 2482cd2
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions tests/background/currentpoller_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
Camera,
Location,
ServiceMessageTypes,
ServiceTypes,
get_current_day_obs,
)
from lsst.ts.rubintv.models.models_helpers import find_first
Expand Down Expand Up @@ -271,15 +272,18 @@ async def test_pick_up_yesterdays_movie(

# assert that notification was made with the new event
# from yesterday.
service_msg = ServiceMessageTypes.CAMERA_PD_BACKDATED
service_type = ServiceTypes.CAMERA
message_type = ServiceMessageTypes.CAMERA_PD_BACKDATED
loc_cam = f"{location.name}/{camera.name}"
events = mocked.get_mocked_events(location, camera, channel)
assert events is not []
last_event = max(events)
assert last_event
assert last_event.day_obs == yesterday.isoformat()
payload = {channel.name: last_event.__dict__}
mock_notify.assert_called_once_with("camera", service_msg, loc_cam, payload)
mock_notify.assert_called_once_with(
service_type, message_type, loc_cam, payload
)


def get_test_camera_and_location() -> tuple[Camera, Location]:
Expand Down

0 comments on commit 2482cd2

Please sign in to comment.