Fix tests due to test reading the local config file

This commit is contained in:
Julien Duponchelle committed 2015-02-13 11:15:11 +01:00
1 parent b419001813
commit a4669689e7
2 files changed
+14 -5

No files matched your search

+4 -3
View File
@@ -35,9 +35,10 @@ def test_locale_check():
assert locale.getlocale() == ('fr_FR', 'UTF-8')
def test_parse_arguments(capsys):
def test_parse_arguments(capsys, tmpdir):
config = Config.instance()
Config.reset()
config = Config.instance(str(tmpdir / "test.cfg"))
server_config = config.get_section_config("Server")
with pytest.raises(SystemExit):
@@ -70,7 +71,7 @@ def test_parse_arguments(capsys):
assert "optional arguments" in out
assert main.parse_arguments(["--host", "192.168.1.1"], server_config).host == "192.168.1.1"
assert main.parse_arguments([], server_config).host == "127.0.0.1"
assert main.parse_arguments([], server_config).host == "0.0.0.0"
server_config["host"] = "192.168.1.2"
assert main.parse_arguments(["--host", "192.168.1.1"], server_config).host == "192.168.1.1"
assert main.parse_arguments([], server_config).host == "192.168.1.2"