1
0
mirror of https://github.com/GNS3/gns3-server synced 2024-11-28 03:08:14 +00:00

Fix tests.

This commit is contained in:
grossmj 2020-04-30 15:49:06 +09:30
parent 02c0fa26e1
commit 6c322bbdde
2 changed files with 4 additions and 3 deletions

View File

@ -223,6 +223,7 @@ class WebServer:
""" """
Called when the HTTP server start Called when the HTTP server start
""" """
await Controller.instance().start() await Controller.instance().start()
# Because with a large image collection # Because with a large image collection
# without md5sum already computed we start the # without md5sum already computed we start the

View File

@ -56,7 +56,7 @@ def test_load_controller_settings(controller, controller_config_path, async_run)
data["gns3vm"] = {"vmname": "Test VM"} data["gns3vm"] = {"vmname": "Test VM"}
with open(controller_config_path, "w+") as f: with open(controller_config_path, "w+") as f:
json.dump(data, f) json.dump(data, f)
assert len(async_run(controller._load_controller_settings())) == 1 assert len(controller._load_controller_settings()) == 1
assert controller.gns3vm.settings["vmname"] == "Test VM" assert controller.gns3vm.settings["vmname"] == "Test VM"
@ -67,7 +67,7 @@ def test_load_controller_settings_with_no_computes_section(controller, controlle
del data['computes'] del data['computes']
with open(controller_config_path, "w+") as f: with open(controller_config_path, "w+") as f:
json.dump(data, f) json.dump(data, f)
assert len(async_run(controller._load_controller_settings())) == 0 assert len(controller._load_controller_settings()) == 0
def test_import_computes_1_x(controller, controller_config_path, async_run): def test_import_computes_1_x(controller, controller_config_path, async_run):
@ -94,7 +94,7 @@ def test_import_computes_1_x(controller, controller_config_path, async_run):
with open(os.path.join(config_dir, "gns3_gui.conf"), "w+") as f: with open(os.path.join(config_dir, "gns3_gui.conf"), "w+") as f:
json.dump(gns3_gui_conf, f) json.dump(gns3_gui_conf, f)
async_run(controller._load_controller_settings()) controller._load_controller_settings()
for compute in controller.computes.values(): for compute in controller.computes.values():
if compute.id != "local": if compute.id != "local":
assert len(compute.id) == 36 assert len(compute.id) == 36