mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-04 22:41:12 +02:00
Refactor tests and upgrade dev package requirements
This commit is contained in:
29 files changed
+5074
-4558
No files matched your search
@@ -29,27 +29,29 @@ from gns3server.utils.path import get_default_project_directory
|
||||
pytestmark = pytest.mark.asyncio
|
||||
|
||||
|
||||
async def test_get(app: FastAPI, compute_client: AsyncClient, windows_platform) -> None:
|
||||
class TestCapabilitiesRoutes:
|
||||
|
||||
response = await compute_client.get(app.url_path_for("compute:get_capabilities"))
|
||||
assert response.status_code == status.HTTP_200_OK
|
||||
assert response.json() == {'node_types': ['cloud', 'ethernet_hub', 'ethernet_switch', 'nat', 'vpcs', 'virtualbox', 'dynamips', 'frame_relay_switch', 'atm_switch', 'qemu', 'vmware', 'docker', 'iou'],
|
||||
'version': __version__,
|
||||
'platform': sys.platform,
|
||||
'cpus': psutil.cpu_count(logical=True),
|
||||
'memory': psutil.virtual_memory().total,
|
||||
'disk_size': psutil.disk_usage(get_default_project_directory()).total,
|
||||
}
|
||||
async def test_get(self, app: FastAPI, compute_client: AsyncClient, windows_platform) -> None:
|
||||
|
||||
response = await compute_client.get(app.url_path_for("compute:get_capabilities"))
|
||||
assert response.status_code == status.HTTP_200_OK
|
||||
assert response.json() == {'node_types': ['cloud', 'ethernet_hub', 'ethernet_switch', 'nat', 'vpcs', 'virtualbox', 'dynamips', 'frame_relay_switch', 'atm_switch', 'qemu', 'vmware', 'docker', 'iou'],
|
||||
'version': __version__,
|
||||
'platform': sys.platform,
|
||||
'cpus': psutil.cpu_count(logical=True),
|
||||
'memory': psutil.virtual_memory().total,
|
||||
'disk_size': psutil.disk_usage(get_default_project_directory()).total,
|
||||
}
|
||||
|
||||
|
||||
async def test_get_on_gns3vm(app: FastAPI, compute_client: AsyncClient, on_gns3vm) -> None:
|
||||
async def test_get_on_gns3vm(self, app: FastAPI, compute_client: AsyncClient, on_gns3vm) -> None:
|
||||
|
||||
response = await compute_client.get(app.url_path_for("compute:get_capabilities"))
|
||||
assert response.status_code == status.HTTP_200_OK
|
||||
assert response.json() == {'node_types': ['cloud', 'ethernet_hub', 'ethernet_switch', 'nat', 'vpcs', 'virtualbox', 'dynamips', 'frame_relay_switch', 'atm_switch', 'qemu', 'vmware', 'docker', 'iou'],
|
||||
'version': __version__,
|
||||
'platform': sys.platform,
|
||||
'cpus': psutil.cpu_count(logical=True),
|
||||
'memory': psutil.virtual_memory().total,
|
||||
'disk_size': psutil.disk_usage(get_default_project_directory()).total,
|
||||
}
|
||||
response = await compute_client.get(app.url_path_for("compute:get_capabilities"))
|
||||
assert response.status_code == status.HTTP_200_OK
|
||||
assert response.json() == {'node_types': ['cloud', 'ethernet_hub', 'ethernet_switch', 'nat', 'vpcs', 'virtualbox', 'dynamips', 'frame_relay_switch', 'atm_switch', 'qemu', 'vmware', 'docker', 'iou'],
|
||||
'version': __version__,
|
||||
'platform': sys.platform,
|
||||
'cpus': psutil.cpu_count(logical=True),
|
||||
'memory': psutil.virtual_memory().total,
|
||||
'disk_size': psutil.disk_usage(get_default_project_directory()).total,
|
||||
}
|
||||
Reference in new issue
Block a user