Skip to content

Commit

Permalink
Update tests for mount_disk_image_and_copy_files
Browse files Browse the repository at this point in the history
  • Loading branch information
tw4l committed Aug 5, 2023
1 parent b7fabbf commit 764daf7
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions disk_image_toolkit/tests/test_disk_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import os
import pytest
import subprocess
from unittest.mock import call

from disk_image_toolkit.dfxml import objects

Expand Down Expand Up @@ -380,8 +381,11 @@ def test_mount_image_and_copy_files(mocker, raw_image, create_dfxml):
else:
assert convert_raw.call_count == 0

cmd = "sudo mount -t udf -o loop '{}' /".format(raw_image)
subprocess_call.assert_called_with(cmd, shell=True)
mount_cmds = [
call("sudo mount -t udf -o loop 'udf-example.dd' /mnt/diskid/", shell=True),
call("sudo umount /mnt/diskid/", shell=True),
]
subprocess_call.assert_has_calls(mount_cmds)

if create_dfxml:
write_dfxml.call_count == 1
Expand Down

0 comments on commit 764daf7

Please sign in to comment.