Skip to content

Commit 0cbe537

Browse files
committed
fix test assertion
1 parent 438324d commit 0cbe537

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

test/unit/object/test_file.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,7 @@ def test_update_contents_with_stream_does_preflight_check_if_specified(
477477
test_file.update_contents_with_stream(**kwargs)
478478

479479
if preflight_check:
480-
assert test_file.preflight_check.called_once_with(size=file_size)
480+
test_file.preflight_check.assert_called_once_with(size=file_size)
481481
if preflight_fails:
482482
assert not mock_box_session.post.called
483483
else:
@@ -508,7 +508,7 @@ def test_update_contents_does_preflight_check_if_specified(
508508
test_file.update_contents(**kwargs)
509509

510510
if preflight_check:
511-
assert test_file.preflight_check.called_once_with(size=file_size)
511+
test_file.preflight_check.assert_called_once_with(size=file_size)
512512
if preflight_fails:
513513
assert not mock_box_session.post.called
514514
else:

test/unit/object/test_folder.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,7 @@ def test_upload_stream_does_preflight_check_if_specified(
403403
test_folder.upload_stream(**kwargs)
404404

405405
if preflight_check:
406-
assert test_folder.preflight_check.called_once_with(size=file_size, name='foo.txt')
406+
test_folder.preflight_check.assert_called_once_with(size=file_size, name='foo.txt')
407407
_assert_post_called_correctly(mock_box_session, preflight_fails)
408408
else:
409409
assert not test_folder.preflight_check.called
@@ -439,7 +439,7 @@ def test_upload_does_preflight_check_if_specified(
439439
test_folder.upload(**kwargs)
440440

441441
if preflight_check:
442-
assert test_folder.preflight_check.called_once_with(size=file_size, name='foo.txt')
442+
test_folder.preflight_check.assert_called_once_with(size=file_size, name='foo.txt')
443443
_assert_post_called_correctly(mock_box_session, preflight_fails)
444444
else:
445445
assert not test_folder.preflight_check.called

test/unit/session/test_session.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,10 +217,10 @@ def test_box_session_seeks_file_after_retry(box_session, mock_network_layer, ser
217217
mock_file_2.tell.assert_called_with()
218218
mock_file_1.seek.assert_called_with(0)
219219
assert mock_file_1.seek.call_count == 2
220-
assert mock_file_1.seek.has_calls(call(0) * 2)
220+
mock_file_1.seek.assert_has_calls([call(0), call(0)])
221221
mock_file_2.seek.assert_called_with(3)
222222
assert mock_file_2.seek.call_count == 2
223-
assert mock_file_2.seek.has_calls(call(3) * 2)
223+
mock_file_2.seek.assert_has_calls([call(3), call(3)])
224224

225225

226226
def test_box_session_raises_for_non_json_response(box_session, mock_network_layer, non_json_response, generic_successful_response, test_url):

0 commit comments

Comments
 (0)