mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-03 22:11:14 +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
@@ -151,9 +151,21 @@ class Config(object):
|
||||
if not self._config.has_section(section):
|
||||
self._config.add_section(section)
|
||||
for key in content:
|
||||
if isinstance(content[key], bool):
|
||||
content[key] = str(content[key]).lower()
|
||||
self._config.set(section, key, content[key])
|
||||
self._override_config[section] = content
|
||||
|
||||
def set(self, section, key, value):
|
||||
"""
|
||||
Set a config value.
|
||||
It's not dumped on the disk.
|
||||
|
||||
If the section doesn't exists the section is created
|
||||
"""
|
||||
|
||||
self.set_section_config(section, {key: value})
|
||||
|
||||
@staticmethod
|
||||
def instance(files=None):
|
||||
"""
|
||||
|
||||
Reference in new issue
Block a user