mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-04 22:41:12 +02:00
Use Pydantic to validate the server config file.
This commit is contained in:
1 parent
478119b40d
commit
30ebae207f
61 files changed
+871
-695
No files matched your search
@@ -19,7 +19,7 @@ import pytest
|
||||
|
||||
from gns3server.controller.gns3vm.remote_gns3_vm import RemoteGNS3VM
|
||||
from gns3server.controller.gns3vm.gns3_vm_error import GNS3VMError
|
||||
|
||||
from pydantic import SecretStr
|
||||
|
||||
@pytest.fixture
|
||||
def gns3vm(controller):
|
||||
@@ -44,7 +44,7 @@ async def test_start(gns3vm, controller):
|
||||
host="r1.local",
|
||||
port=8484,
|
||||
user="hello",
|
||||
password="world",
|
||||
password=SecretStr("world"),
|
||||
connect=False)
|
||||
|
||||
gns3vm.vmname = "R1"
|
||||
@@ -54,7 +54,7 @@ async def test_start(gns3vm, controller):
|
||||
assert gns3vm.ip_address == "r1.local"
|
||||
assert gns3vm.port == 8484
|
||||
assert gns3vm.user == "hello"
|
||||
assert gns3vm.password == "world"
|
||||
assert gns3vm.password.get_secret_value() == "world"
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
@@ -66,7 +66,7 @@ async def test_start_invalid_vm(gns3vm, controller):
|
||||
host="r1.local",
|
||||
port=8484,
|
||||
user="hello",
|
||||
password="world")
|
||||
password=SecretStr("world"))
|
||||
|
||||
gns3vm.vmname = "R2"
|
||||
with pytest.raises(GNS3VMError):
|
||||
|
||||
Reference in new issue
Block a user