Override configuration from command line even in case of config reload

This commit is contained in:
Julien Duponchelle committed 2015-02-02 15:08:46 +01:00
1 parent 6abf420ce1
commit 0ae8d8031a
2 files changed
+31 -1

No files matched your search

+23
View File
@@ -95,3 +95,26 @@ def test_check_config_file_change(tmpdir):
config._check_config_file_change()
assert dict(config.get_section_config("Server")) == {"host": "192.168.1.1"}
def test_check_config_file_change_override_cmdline(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"})
assert dict(config.get_section_config("Server")) == {"host": "192.168.1.1"}
path = write_config(tmpdir, {
"Server": {
"host": "192.168.1.2"
}
})
os.utime(path, (time.time() + 1, time.time() + 1))
config._check_config_file_change()
assert dict(config.get_section_config("Server")) == {"host": "192.168.1.1"}