mirror of
https://github.com/GNS3/gns3-server.git
synced 2025-06-21 08:29:43 +00:00
Add a custom version to an appliance
This commit is contained in:
@ -66,3 +66,28 @@ class TestApplianceRoutes:
|
||||
appliance_id = "1cfdf900-7c30-4cb7-8f03-3f61d2581633" # Empty VM appliance
|
||||
response = await client.post(app.url_path_for("install_appliance", appliance_id=appliance_id))
|
||||
assert response.status_code == status.HTTP_400_BAD_REQUEST
|
||||
|
||||
async def test_add_version_appliance(self, app: FastAPI, client: AsyncClient) -> None:
|
||||
|
||||
appliance_id = "1cfdf900-7c30-4cb7-8f03-3f61d2581633" # Empty VM appliance
|
||||
new_version = {
|
||||
"name": "99G",
|
||||
"images": {
|
||||
"hda_disk_image": "empty99G.qcow2"
|
||||
}
|
||||
}
|
||||
response = await client.post(app.url_path_for("add_appliance_version", appliance_id=appliance_id), json=new_version)
|
||||
assert response.status_code == status.HTTP_201_CREATED
|
||||
assert new_version in response.json()["versions"]
|
||||
|
||||
async def test_add_existing_version_appliance(self, app: FastAPI, client: AsyncClient) -> None:
|
||||
|
||||
appliance_id = "1cfdf900-7c30-4cb7-8f03-3f61d2581633" # Empty VM appliance
|
||||
new_version = {
|
||||
"name": "8G",
|
||||
"images": {
|
||||
"hda_disk_image": "empty8G.qcow2"
|
||||
}
|
||||
}
|
||||
response = await client.post(app.url_path_for("add_appliance_version", appliance_id=appliance_id), json=new_version)
|
||||
assert response.status_code == status.HTTP_409_CONFLICT
|
||||
|
Reference in New Issue
Block a user