Skip to content

Commit

Permalink
Fix up merge conflicts in unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
markgoddard committed Jul 2, 2024
1 parent 7248c46 commit 37e0f4b
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions nova/tests/unit/virt/libvirt/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,15 @@ def test_create_image(self, mock_execute):
@mock.patch('os.path.exists', return_value=True)
@mock.patch('oslo_concurrency.processutils.execute')
@mock.patch('nova.virt.images.qemu_img_info')
def test_create_cow_image(self, mock_info, mock_execute, mock_exists):
@mock.patch('nova.image.format_inspector.detect_file_format')
def test_create_cow_image(self, mock_detect, mock_info, mock_execute,
mock_exists):
mock_execute.return_value = ('stdout', None)
mock_info.return_value = mock.Mock(
file_format=mock.sentinel.backing_fmt,
cluster_size=mock.sentinel.cluster_size)
cluster_size=mock.sentinel.cluster_size,
backing_file=None)
mock_detect.return_value.safety_check.return_value = True
libvirt_utils.create_cow_image(mock.sentinel.backing_path,
mock.sentinel.new_path)
mock_info.assert_called_once_with(mock.sentinel.backing_path)
Expand All @@ -131,6 +135,7 @@ def test_create_cow_image(self, mock_info, mock_execute, mock_exists):
mock.sentinel.backing_path, mock.sentinel.backing_fmt,
mock.sentinel.cluster_size),
mock.sentinel.new_path)])
mock_detect.return_value.safety_check.assert_called_once_with()

@ddt.unpack
@ddt.data({'fs_type': 'some_fs_type',
Expand Down

0 comments on commit 37e0f4b

Please sign in to comment.