Skip to content

Commit 3098a70

Browse files
author
Soheyl
committed
test: allow multiple write calls in unit test
1 parent b16d471 commit 3098a70

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

tests/unit/test_redact_pii.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,9 @@ def test_save_pii_redacted_audio(httpx_mock: HTTPXMock, mocker: MockerFixture):
382382
mock_file.assert_called_once_with(downloaded_filepath, "wb")
383383

384384
# Ensure correct file content was written
385-
mock_file().write.assert_called_once_with(mock_audio_file_bytes)
385+
write_calls = mock_file().write.call_args_list
386+
full_written_bytes = b"".join(call.args[0] for call in write_calls)
387+
assert full_written_bytes == mock_audio_file_bytes
386388

387389

388390
def test_save_pii_redacted_audio_fails_if_redact_pii_not_enabled_for_transcript(

0 commit comments

Comments
 (0)