Refactor config management in tests

This commit is contained in:
Julien Duponchelle committed 2015-03-16 15:03:41 +01:00
1 parent e54649accd
commit bcb1ce02ab
6 files changed
+42 -36

No files matched your search

+14 -1
View File
@@ -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"}