mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-21 05:35:15 +02:00
Refactor config management in tests
This commit is contained in:
1 parent
e54649accd
commit
bcb1ce02ab
6 files changed
+42
-36
No files matched your search
+14
-1
@@ -67,13 +67,26 @@ def test_get_section_config(tmpdir):
|
||||
|
||||
def test_set_section_config(tmpdir):
|
||||
|
||||
config = load_config(tmpdir, {
|
||||
"Server": {
|
||||
"host": "127.0.0.1",
|
||||
"local": "false"
|
||||
}
|
||||
})
|
||||
assert dict(config.get_section_config("Server")) == {"host": "127.0.0.1", "local": "false"}
|
||||
config.set_section_config("Server", {"host": "192.168.1.1", "local": True})
|
||||
assert dict(config.get_section_config("Server")) == {"host": "192.168.1.1", "local": "true"}
|
||||
|
||||
|
||||
def test_set(tmpdir):
|
||||
|
||||
config = load_config(tmpdir, {
|
||||
"Server": {
|
||||
"host": "127.0.0.1"
|
||||
}
|
||||
})
|
||||
assert dict(config.get_section_config("Server")) == {"host": "127.0.0.1"}
|
||||
config.set_section_config("Server", {"host": "192.168.1.1"})
|
||||
config.set("Server", "host", "192.168.1.1")
|
||||
assert dict(config.get_section_config("Server")) == {"host": "192.168.1.1"}
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user