mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-03 05:51:15 +02:00
Return md5sum and filesize in the list of images
Ref https://github.com/GNS3/gns3-gui/issues/1590
This commit is contained in:
10 files changed
+49
-18
No files matched your search
@@ -156,7 +156,11 @@ def test_images(http_compute, tmpdir, fake_dynamips, fake_file):
|
||||
with patch("gns3server.compute.Dynamips.get_images_directory", return_value=str(tmpdir), example=True):
|
||||
response = http_compute.get("/dynamips/images")
|
||||
assert response.status == 200
|
||||
assert response.json == [{"filename": "7200.bin", "path": "7200.bin"}]
|
||||
assert response.json == [{"filename": "7200.bin",
|
||||
"path": "7200.bin",
|
||||
"filesize": 7,
|
||||
"md5sum": "b0d5aa897d937aced5a6b1046e8f7e2e"
|
||||
}]
|
||||
|
||||
|
||||
def test_upload_image(http_compute, tmpdir):
|
||||
|
||||
@@ -307,7 +307,7 @@ def test_images(http_compute, fake_iou_bin):
|
||||
|
||||
response = http_compute.get("/iou/images", example=True)
|
||||
assert response.status == 200
|
||||
assert response.json == [{"filename": "iou.bin", "path": "iou.bin"}]
|
||||
assert response.json == [{"filename": "iou.bin", "path": "iou.bin", "filesize": 7, "md5sum": "e573e8f5c93c6c00783f20c7a170aa6c"}]
|
||||
|
||||
|
||||
def test_image_vm(http_compute, tmpdir):
|
||||
|
||||
@@ -226,7 +226,7 @@ def test_images(http_compute, tmpdir, fake_qemu_vm):
|
||||
|
||||
response = http_compute.get("/qemu/images")
|
||||
assert response.status == 200
|
||||
assert response.json == [{"filename": "linux载.img", "path": "linux载.img"}]
|
||||
assert response.json == [{"filename": "linux载.img", "path": "linux载.img", "md5sum": "c4ca4238a0b923820dcc509a6f75849b", "filesize": 1}]
|
||||
|
||||
|
||||
def test_upload_image(http_compute, tmpdir):
|
||||
|
||||
Reference in new issue
Block a user