From bfe93761d19da7a6934ca29d2cef287178612c93 Mon Sep 17 00:00:00 2001 From: Mekhla Kapoor <54870020+mekhlakapoor@users.noreply.github.com> Date: Wed, 23 Oct 2024 18:14:57 -0700 Subject: [PATCH] Patch 52 (#54) * fix types for EcephysSession * forgot stim_epochs * fixes test --- src/aind_slims_api/operations/ecephys_session.py | 4 ++-- tests/test_operations/test_ecephys_session.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/aind_slims_api/operations/ecephys_session.py b/src/aind_slims_api/operations/ecephys_session.py index 3275ef2..e693a71 100644 --- a/src/aind_slims_api/operations/ecephys_session.py +++ b/src/aind_slims_api/operations/ecephys_session.py @@ -31,7 +31,7 @@ class SlimsRewardDeliveryInfo(BaseModel): """Pydantic Model to store Reward Delivery Info""" reward_delivery: Optional[SlimsRewardDeliveryRdrc] = None - reward_spouts: Optional[SlimsRewardSpoutsRdrc] = [] + reward_spouts: Optional[SlimsRewardSpoutsRdrc] = None class SlimsStreamModule(SlimsDomeModuleRdrc): @@ -162,7 +162,7 @@ def _process_single_step(self, group_run_step, session_run_step) -> EcephysSessi session_result=session, streams=streams or None, reward_delivery=reward_delivery, - stimulus_epochs=stimulus_epochs or None, + stimulus_epochs=stimulus_epochs or [], ) def process_session_steps( diff --git a/tests/test_operations/test_ecephys_session.py b/tests/test_operations/test_ecephys_session.py index 53a15e2..bc11d06 100644 --- a/tests/test_operations/test_ecephys_session.py +++ b/tests/test_operations/test_ecephys_session.py @@ -152,7 +152,7 @@ def test_fetch_ecephys_sessions_success(self): self.assertEqual(len(ecephys_session.streams), 1) self.assertEqual(ecephys_session.streams[0].daq_names, ["DAQ1", "DAQ2"]) self.assertEqual(len(ecephys_session.streams[0].stream_modules), 2) - self.assertIsNone(ecephys_session.stimulus_epochs) + self.assertEqual(ecephys_session.stimulus_epochs, []) def test_fetch_ecephys_sessions_handle_exception(self): """Tests that exception is handled as expected"""