Add controller endpoints to get VirtualBox VMs, VMware VMs and Docker images

This commit is contained in:
grossmj
2022-06-07 00:38:59 +08:00
parent 3b7dfe5929
commit 7d49b80e6b
6 changed files with 91 additions and 66 deletions

View File

@ -397,29 +397,6 @@ async def test_forward_post(compute):
await compute.close()
@pytest.mark.asyncio
async def test_images(compute):
"""
Will return image on compute
"""
response = MagicMock()
response.status = 200
response.read = AsyncioMagicMock(return_value=json.dumps([{
"filename": "linux.qcow2",
"path": "linux.qcow2",
"md5sum": "d41d8cd98f00b204e9800998ecf8427e",
"filesize": 0}]).encode())
with asyncio_patch("aiohttp.ClientSession.request", return_value=response) as mock:
images = await compute.images("qemu")
mock.assert_called_with("GET", "https://example.com:84/v3/compute/qemu/images", auth=None, data=None, headers={'content-type': 'application/json'}, chunked=None, timeout=None)
await compute.close()
assert images == [
{"filename": "linux.qcow2", "path": "linux.qcow2", "md5sum": "d41d8cd98f00b204e9800998ecf8427e", "filesize": 0}
]
@pytest.mark.asyncio
async def test_list_files(project, compute):