Use Pydantic to validate the server config file.

This commit is contained in:
grossmj committed 2021-04-12 17:02:23 +09:30
1 parent 478119b40d
commit 30ebae207f
61 files changed
+871 -695

No files matched your search

+3 -2
View File
@@ -21,6 +21,7 @@ from tests.utils import asyncio_patch, AsyncioMagicMock
from gns3server.controller.gns3vm import GNS3VM
from gns3server.controller.gns3vm.gns3_vm_error import GNS3VMError
from pydantic import SecretStr
@pytest.fixture
@@ -32,7 +33,7 @@ def dummy_engine():
engine.protocol = "https"
engine.port = 8442
engine.user = "hello"
engine.password = "world"
engine.password = SecretStr("world")
return engine
@@ -102,7 +103,7 @@ async def test_auto_start(controller, dummy_gns3vm, dummy_engine):
assert controller.computes["vm"].port == 80
assert controller.computes["vm"].protocol == "https"
assert controller.computes["vm"].user == "hello"
assert controller.computes["vm"].password == "world"
assert controller.computes["vm"].password.get_secret_value() == "world"
@pytest.mark.skipif(sys.platform.startswith("win"), reason="Not working well on Windows")