Skip to content

Commit a8750ef

Browse files
committed
Increase coverage
1 parent 8f23dfa commit a8750ef

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

ibllib/tests/qc/test_dlc_qc.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,21 @@ def tearDownClass(cls) -> None:
3333
def test_ensure_data(self):
3434
self.qc.eid = self.eid
3535
self.qc.download_data = False
36-
# If data for this session exists locally, remove a file so that the test fails as intended
36+
# Remove file so that the test fails as intended
3737
if self.qc.session_path.exists():
3838
self.qc.session_path.joinpath('alf/_ibl_leftCamera.dlc.pqt').unlink()
39-
with self.assertRaises(AssertionError):
39+
with self.assertRaises(AssertionError) as excp:
4040
self.qc.run(update=False)
41+
msg = excp.exception.args[0]
42+
self.assertEqual(msg, 'Dataset _ibl_leftCamera.dlc.* not found locally and download_data is False')
43+
# Set download_data to True. Data is not in the database so we expect a (different) error trying to download
44+
self.qc.download_data = True
45+
with self.assertRaises(AssertionError) as excp:
46+
self.qc.run(update=False)
47+
msg = excp.exception.args[0]
48+
self.assertEqual(msg, 'Dataset _ibl_leftCamera.dlc.* not found locally and failed to download')
49+
50+
4151

4252
def test_check_time_trace_length_match(self):
4353
self.qc.data['dlc_coords'] = {'nose_tip': np.ones((2, 20)), 'pupil_r': np.ones((2, 20))}

0 commit comments

Comments
 (0)