Example #1
0
 def test_qemu_img_info_path_exists(self, path_exists_mock,
                                    qemu_img_info_mock, execute_mock):
     images.qemu_img_info('img')
     path_exists_mock.assert_called_once_with('img')
     execute_mock.assert_called_once_with('env', 'LC_ALL=C', 'LANG=C',
                                          'qemu-img', 'info', 'img')
     qemu_img_info_mock.assert_called_once_with('out')
Example #2
0
 def test_qemu_img_info_path_exists(self, path_exists_mock,
                                    qemu_img_info_mock, execute_mock):
     images.qemu_img_info('img')
     path_exists_mock.assert_called_once_with('img')
     execute_mock.assert_called_once_with('env', 'LC_ALL=C', 'LANG=C',
                                          'qemu-img', 'info', 'img')
     qemu_img_info_mock.assert_called_once_with('out')
Example #3
0
def populate_image(src, dst):
    data = images.qemu_img_info(src)
    if data.file_format == 'raw':
        dd(src, dst)
    else:
        images.convert_image(src, dst, 'raw', True)
Example #4
0
 def test_qemu_img_info_path_doesnt_exist(self, path_exists_mock,
                                          qemu_img_info_mock):
     images.qemu_img_info('noimg')
     path_exists_mock.assert_called_once_with('noimg')
     qemu_img_info_mock.assert_called_once_with()
Example #5
0
 def test_qemu_img_info_path_doesnt_exist(self, path_exists_mock,
                                          qemu_img_info_mock):
     images.qemu_img_info('noimg')
     path_exists_mock.assert_called_once_with('noimg')
     qemu_img_info_mock.assert_called_once_with()
Example #6
0
 def test_qemu_img_info_path_exists(self, path_exists_mock, qemu_img_info_mock, execute_mock):
     images.qemu_img_info("img")
     path_exists_mock.assert_called_once_with("img")
     execute_mock.assert_called_once_with("env", "LC_ALL=C", "LANG=C", "qemu-img", "info", "img")
     qemu_img_info_mock.assert_called_once_with("out")