Remove generic controller settings API endpoint.

This commit is contained in:
grossmj committed 2018-11-14 16:24:30 +08:00
1 parent cebb56387a
commit 98f04365b7
15 files changed
+120 -118

No files matched your search

+1 -10
View File
@@ -35,7 +35,7 @@ def test_save(controller, controller_config_path):
data = json.load(f)
assert data["computes"] == []
assert data["version"] == __version__
assert data["settings"] == {}
assert data["iou_license"] == controller.iou_license
assert data["gns3vm"] == controller.gns3vm.__json__()
@@ -53,12 +53,10 @@ def test_load_controller_settings(controller, controller_config_path, async_run)
"compute_id": "test1"
}
]
data["settings"] = {"IOU": {"test": True}}
data["gns3vm"] = {"vmname": "Test VM"}
with open(controller_config_path, "w+") as f:
json.dump(data, f)
assert len(async_run(controller._load_controller_settings())) == 1
assert controller.settings["IOU"]
assert controller.gns3vm.settings["vmname"] == "Test VM"
@@ -199,13 +197,6 @@ def test_import_remote_gns3vm_1_x(controller, controller_config_path, async_run)
assert controller.gns3vm.settings["vmname"] == "http://127.0.0.1:3081"
def test_settings(controller):
controller._notification = MagicMock()
controller.settings = {"a": 1}
controller._notification.controller_emit.assert_called_with("settings.updated", controller.settings)
assert controller.settings["modification_uuid"] is not None
def test_load_projects(controller, projects_dir, async_run):
controller.save()
+4 -4
View File
@@ -269,7 +269,7 @@ def test_symbol(node, symbols_dir):
assert node.height == 71
assert node.label["x"] is None
assert node.label["y"] == -40
assert node.label["style"] == "font-size: 10;font-familly: Verdana"
assert node.label["style"] == None#"font-family: TypeWriter;font-size: 10.0;font-weight: bold;fill: #000000;fill-opacity: 1.0;"
shutil.copy(os.path.join("gns3server", "symbols", "cloud.svg"), os.path.join(symbols_dir, "cloud2.svg"))
node.symbol = "cloud2.svg"
@@ -298,7 +298,7 @@ def test_label_with_default_label_font(node):
node._label = None
node.symbol = ":/symbols/dslam.svg"
assert node.label["style"] == "font-family: TypeWriter;font-size: 10;font-weight: bold;fill: #ff0000;fill-opacity: 1.0;"
assert node.label["style"] == None #"font-family: TypeWriter;font-size: 10;font-weight: bold;fill: #ff0000;fill-opacity: 1.0;"
def test_update(node, compute, project, async_run, controller):
@@ -405,9 +405,9 @@ def test_start_iou(compute, project, async_run, controller):
with pytest.raises(aiohttp.web.HTTPConflict):
async_run(node.start())
controller.settings["IOU"] = {"iourc_content": "aa"}
controller._iou_license_settings = {"license_check": True, "iourc_content": "aa"}
async_run(node.start())
compute.post.assert_called_with("/projects/{}/iou/nodes/{}/start".format(node.project.id, node.id), timeout=240, data={"iourc_content": "aa"})
compute.post.assert_called_with("/projects/{}/iou/nodes/{}/start".format(node.project.id, node.id), timeout=240, data={"license_check": True, "iourc_content": "aa"})
def test_stop(node, compute, project, async_run):