mirror of
https://github.com/GNS3/gns3-server.git
synced 2024-12-24 06:56:42 +00:00
parent
73c31b4b87
commit
cc6f4c0510
@ -18,6 +18,7 @@
|
|||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
import json
|
import json
|
||||||
|
import uuid
|
||||||
import socket
|
import socket
|
||||||
import asyncio
|
import asyncio
|
||||||
import aiohttp
|
import aiohttp
|
||||||
@ -253,6 +254,7 @@ class Controller:
|
|||||||
@settings.setter
|
@settings.setter
|
||||||
def settings(self, val):
|
def settings(self, val):
|
||||||
self._settings = val
|
self._settings = val
|
||||||
|
self._settings["modification_uuid"] = str(uuid.uuid4()) # We add a modification id to the settings it's help the gui to detect changes
|
||||||
self.save()
|
self.save()
|
||||||
self.notification.emit("settings.updated", val)
|
self.notification.emit("settings.updated", val)
|
||||||
|
|
||||||
|
@ -195,7 +195,8 @@ def test_import_remote_gns3vm_1_x(controller, controller_config_path, async_run)
|
|||||||
def test_settings(controller):
|
def test_settings(controller):
|
||||||
controller._notification = MagicMock()
|
controller._notification = MagicMock()
|
||||||
controller.settings = {"a": 1}
|
controller.settings = {"a": 1}
|
||||||
controller._notification.emit.assert_called_with("settings.updated", {"a": 1})
|
controller._notification.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):
|
def test_load_projects(controller, projects_dir, async_run):
|
||||||
|
@ -29,4 +29,5 @@ def test_settings(http_controller):
|
|||||||
assert response.status == 201
|
assert response.status == 201
|
||||||
response = http_controller.get('/settings', example=True)
|
response = http_controller.get('/settings', example=True)
|
||||||
assert response.status == 200
|
assert response.status == 200
|
||||||
assert response.json == query
|
assert response.json["test"] is True
|
||||||
|
assert response.json["modification_uuid"] is not None
|
||||||
|
Loading…
Reference in New Issue
Block a user