mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-03 05:51:15 +02:00
Fix tests due to test reading the local config file
This commit is contained in:
1 parent
b419001813
commit
a4669689e7
2 files changed
+14
-5
No files matched your search
+4
-3
@@ -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"
|
||||
|
||||
Reference in new issue
Block a user