mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-03 22:11:14 +02:00
Refactor tests and start work on database integration.
This commit is contained in:
1 parent
ae55c0ec9c
commit
bf7cf862af
69 files changed
+2955
-1877
No files matched your search
@@ -35,6 +35,12 @@ class ControllerNotFoundError(ControllerError):
|
||||
super().__init__(message)
|
||||
|
||||
|
||||
class ControllerBadRequestError(ControllerError):
|
||||
|
||||
def __init__(self, message: str):
|
||||
super().__init__(message)
|
||||
|
||||
|
||||
class ControllerUnauthorizedError(ControllerError):
|
||||
|
||||
def __init__(self, message: str):
|
||||
|
||||
@@ -100,12 +100,12 @@ class Template:
|
||||
try:
|
||||
template_schema = TEMPLATE_TYPE_TO_SHEMA[self.template_type]
|
||||
template_settings_with_defaults = template_schema.parse_obj(self.__json__())
|
||||
self._settings = template_settings_with_defaults.dict()
|
||||
self._settings = jsonable_encoder(template_settings_with_defaults.dict())
|
||||
if self.template_type == "dynamips":
|
||||
# special case for Dynamips to cover all platform types that contain specific settings
|
||||
dynamips_template_schema = DYNAMIPS_PLATFORM_TO_SHEMA[self._settings["platform"]]
|
||||
dynamips_template_settings_with_defaults = dynamips_template_schema.parse_obj(self.__json__())
|
||||
self._settings = dynamips_template_settings_with_defaults.dict()
|
||||
self._settings = jsonable_encoder(dynamips_template_settings_with_defaults.dict())
|
||||
except ValidationError as e:
|
||||
print(e) #TODO: handle errors
|
||||
raise
|
||||
|
||||
Reference in new issue
Block a user