Skip to content

Commit

Permalink
Fix mock assertions
Browse files Browse the repository at this point in the history
  • Loading branch information
pnuu committed Feb 27, 2024
1 parent 4bc97d5 commit 43f9053
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions trollmoves/tests/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -358,17 +358,17 @@ def test_unpack_xrit(check_output, remove):
# Define xritdecompressor path
kwargs = {'xritdecompressor': '/path/to/xRITDecompress'}
res = unpack_xrit(fname_in, **kwargs)
assert check_output.called_once_with(
check_output.assert_called_once_with(
['/path/to/xRITDecompress', fname_in], cwd=('/tmp'))
remove.assert_not_called()

# Define also delete
kwargs = {'delete': True, 'xritdecompressor': '/path/to/xRITDecompress'}

res = unpack_xrit(fname_in, **kwargs)
assert check_output.called_once_with(
check_output.assert_called_once_with(
['/path/to/xRITDecompress', fname_in], cwd=('/tmp'))
assert remove.called_once_with(fname_in)
remove.assert_called_once_with(fname_in)


def test_unpack_bzip():
Expand Down Expand Up @@ -543,7 +543,7 @@ def test_unpack_and_create_local_message_xrit_compression_with_delete(unpackers)
unpackers['xrit'].return_value = 'new_file1.png'
with patch('os.remove') as remove:
_ = unp(copy.copy(MSG_FILE_XRIT), LOCAL_DIR, **kwargs)
assert remove.called_once_with(os.path.join(LOCAL_DIR, MSG_FILE_XRIT.data['uid']))
remove.assert_called_once_with(os.path.join(LOCAL_DIR, MSG_FILE_XRIT.data['uid']))
del kwargs['delete']


Expand Down

0 comments on commit 43f9053

Please sign in to comment.