Skip to content

Commit

Permalink
Update test_video.py
Browse files Browse the repository at this point in the history
  • Loading branch information
bimac committed May 21, 2024
1 parent 19a6ea9 commit d4cd094
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions iblrig/test/test_video.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@


class TestDownloadFunction(unittest.TestCase):
@patch('one.webclient.AlyxClient.download_file', return_value=('mocked_tmp_file', 'mocked_md5_checksum'))
@patch('iblrig.video.aws.s3_download_file', return_value=Path('mocked_tmp_file'))
@patch('iblrig.video.hashfile.md5', return_value='mocked_md5_checksum')
@patch('os.rename', return_value=None)
def test_download_from_alyx_or_flir(self, mock_os_rename, mock_alyx_download):
def test_download_from_alyx_or_flir(self, mock_os_rename, mock_hashfile, mock_aws_download):
asset = 123
filename = 'test_file.txt'

Expand All @@ -31,10 +32,9 @@ def test_download_from_alyx_or_flir(self, mock_os_rename, mock_alyx_download):
# Assertions
expected_out_file = Path.home().joinpath('Downloads', filename)
self.assertEqual(result, expected_out_file)
mock_alyx_download.assert_called_once_with(
f'resources/spinnaker/{filename}', target_dir=Path(expected_out_file.parent), clobber=True, return_md5=True
)
mock_os_rename.assert_called_once_with('mocked_tmp_file', expected_out_file)
mock_hashfile.assert_called()
mock_aws_download.assert_called_once_with(source=f'resources/{filename}', destination=Path(expected_out_file))
mock_os_rename.assert_called_once_with(Path('mocked_tmp_file'), expected_out_file)


class TestSettings(unittest.TestCase):
Expand Down

0 comments on commit d4cd094

Please sign in to comment.