mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-03 14:01:15 +02:00
Fix issue when images are not uploaded from appliance wizard. Ref https://github.com/GNS3/gns3-gui/issues/2738
This commit is contained in:
1 parent
4e396ac690
commit
03401a477e
4 files changed
+9
-12
No files matched your search
@@ -348,7 +348,7 @@ def test_forward_post(compute, async_run):
|
||||
|
||||
def test_images(compute, async_run, images_dir):
|
||||
"""
|
||||
Will return image on compute and on controller
|
||||
Will return image on compute
|
||||
"""
|
||||
response = MagicMock()
|
||||
response.status = 200
|
||||
@@ -357,14 +357,12 @@ def test_images(compute, async_run, images_dir):
|
||||
"path": "linux.qcow2",
|
||||
"md5sum": "d41d8cd98f00b204e9800998ecf8427e",
|
||||
"filesize": 0}]).encode())
|
||||
open(os.path.join(images_dir, "QEMU", "asa.qcow2"), "w+").close()
|
||||
with asyncio_patch("aiohttp.ClientSession.request", return_value=response) as mock:
|
||||
images = async_run(compute.images("qemu"))
|
||||
mock.assert_called_with("GET", "https://example.com:84/v2/compute/qemu/images", auth=None, data=None, headers={'content-type': 'application/json'}, chunked=None, timeout=None)
|
||||
async_run(compute.close())
|
||||
|
||||
assert images == [
|
||||
{"filename": "asa.qcow2", "path": "asa.qcow2", "md5sum": "d41d8cd98f00b204e9800998ecf8427e", "filesize": 0},
|
||||
{"filename": "linux.qcow2", "path": "linux.qcow2", "md5sum": "d41d8cd98f00b204e9800998ecf8427e", "filesize": 0}
|
||||
]
|
||||
|
||||
|
||||
Reference in new issue
Block a user