mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-06 15:21:13 +02:00
Add endpoint to list the compute nodes
This commit is contained in:
4 files changed
+45
-2
No files matched your search
@@ -34,3 +34,33 @@ def test_compute_create(http_controller, controller):
|
||||
|
||||
assert len(controller.computes) == 1
|
||||
assert controller.computes["my_compute_id"].host == "example.com"
|
||||
|
||||
|
||||
def test_compute_list(http_controller, controller):
|
||||
|
||||
params = {
|
||||
"compute_id": "my_compute_id",
|
||||
"protocol": "http",
|
||||
"host": "example.com",
|
||||
"port": 84,
|
||||
"user": "julien",
|
||||
"password": "secure"
|
||||
}
|
||||
response = http_controller.post("/computes", params)
|
||||
assert response.status == 201
|
||||
assert response.route == "/computes"
|
||||
assert response.json["user"] == "julien"
|
||||
assert "password" not in response.json
|
||||
|
||||
response = http_controller.get("/computes", example=True)
|
||||
assert response.json == [
|
||||
{
|
||||
'compute_id': 'my_compute_id',
|
||||
'connected': False,
|
||||
'host': 'example.com',
|
||||
'port': 84,
|
||||
'protocol': 'http',
|
||||
'user': 'julien'
|
||||
}
|
||||
]
|
||||
|
||||
Reference in new issue
Block a user