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')
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)
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()
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")