mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-03 05:51:15 +02:00
4 files changed
+6
-1
No files matched your search
@@ -223,6 +223,7 @@ def test_close(compute, async_run):
|
||||
|
||||
def test_update(compute, controller, async_run):
|
||||
compute._controller._notification = MagicMock()
|
||||
compute._controller.save = MagicMock()
|
||||
compute.name = "Test"
|
||||
compute.host = "example.org"
|
||||
compute._connected = True
|
||||
@@ -231,6 +232,7 @@ def test_update(compute, controller, async_run):
|
||||
assert compute.host == "example.org"
|
||||
controller.notification.emit.assert_called_with("compute.updated", compute.__json__())
|
||||
assert compute.connected is False
|
||||
assert compute._controller.save.called
|
||||
|
||||
|
||||
def test_forward_get(compute, async_run):
|
||||
|
||||
@@ -102,13 +102,14 @@ def test_deleteCompute(controller, controller_config_path, async_run):
|
||||
|
||||
|
||||
def test_addComputeConfigFile(controller, controller_config_path, async_run):
|
||||
async_run(controller.add_compute(compute_id="test1"))
|
||||
async_run(controller.add_compute(compute_id="test1", name="Test"))
|
||||
assert len(controller.computes) == 1
|
||||
with open(controller_config_path) as f:
|
||||
data = json.load(f)
|
||||
assert data["computes"] == [
|
||||
{
|
||||
'compute_id': 'test1',
|
||||
'name': 'Test',
|
||||
'host': 'localhost',
|
||||
'port': 3080,
|
||||
'protocol': 'http',
|
||||
|
||||
Reference in new issue
Block a user