Commit 5589c5a0 authored by FH's avatar FH

corrected config["config_file"]

to config_file
parent 05d35f5f
......@@ -28,7 +28,7 @@ class TestPacmanMirrors(unittest.TestCase):
"-m", "random",
"-d", "data/mirrors"]):
app = pacman_mirrors.PacmanMirrors()
app.config["config_file"] = "conf/pacman-mirrors.conf"
app.config_file = "conf/pacman-mirrors.conf"
app.command_line_parse()
app.load_server_lists()
......@@ -43,7 +43,7 @@ class TestPacmanMirrors(unittest.TestCase):
"-m", "random",
"-d", "data/mirrors"]):
app = pacman_mirrors.PacmanMirrors()
app.config["config_file"] = "conf/pacman-mirrors.conf"
app.config_file = "conf/pacman-mirrors.conf"
app.command_line_parse()
app.load_server_lists()
assert app.config["only_country"] == ["Germany"]
......@@ -61,7 +61,7 @@ class TestPacmanMirrors(unittest.TestCase):
"-m", "random",
"-d", "data/mirrors"]):
app = pacman_mirrors.PacmanMirrors()
app.config["config_file"] = "conf/pacman-mirrors.conf"
app.config_file = "conf/pacman-mirrors.conf"
app.command_line_parse()
app.load_server_lists()
assert app.config["only_country"] == ["France"]
......@@ -79,7 +79,7 @@ class TestPacmanMirrors(unittest.TestCase):
"-m", "random",
"-d", "data/mirrors"]):
app = pacman_mirrors.PacmanMirrors()
app.config["config_file"] = "conf/pacman-mirrors.conf"
app.config_file = "conf/pacman-mirrors.conf"
app.config["only_country"] = []
app.command_line_parse()
app.load_server_lists()
......@@ -89,7 +89,7 @@ class TestPacmanMirrors(unittest.TestCase):
def test_resp_time_calc(self, mock_calc):
"""Calculate mirror response time"""
app = pacman_mirrors.PacmanMirrors()
app.config["config_file"] = "conf/pacman-mirrors.conf"
app.config_file = "conf/pacman-mirrors.conf"
mock_calc.return_value = "0.067"
assert app.get_mirror_response_time(
"1486371026.6549892", "1486371026.7216527") == "0.067"
......@@ -104,7 +104,7 @@ class TestPacmanMirrors(unittest.TestCase):
def test_last_sync_calc(self, mock_calc):
"""Calculate mirror last_sync offset"""
app = pacman_mirrors.PacmanMirrors()
app.config["config_file"] = "conf/pacman-mirrors.conf"
app.config_file = "conf/pacman-mirrors.conf"
mock_calc.return_value = "2189:29"
assert app.get_mirror_branch_last_sync(
"2017-02-06 11:39:14.610344", "2016-11-07 06:09:51") == "2189:29"
......@@ -120,7 +120,7 @@ class TestPacmanMirrors(unittest.TestCase):
"""Extract mirror url from input"""
mock_url.return_value = "http://mirror.domain.tld"
app = pacman_mirrors.PacmanMirrors()
app.config["config_file"] = "conf/pacman-mirrors.conf"
app.config_file = "conf/pacman-mirrors.conf"
mock_data = "Server = http://mirror.domain.tld"
assert app.get_mirror_url(mock_data) == "http://mirror.domain.tld"
......@@ -129,7 +129,7 @@ class TestPacmanMirrors(unittest.TestCase):
"""Extract mirror country from input"""
mock_country.return_value = "France"
app = pacman_mirrors.PacmanMirrors()
app.config["config_file"] = "conf/pacman-mirrors.conf"
app.config_file = "conf/pacman-mirrors.conf"
mock_data = "## Country : France"
assert app.get_mirror_country(mock_data) == "France"
mock_data = "## Location : France"
......@@ -142,7 +142,7 @@ class TestPacmanMirrors(unittest.TestCase):
"""Extract timestamp from input"""
mock_timestamp.return_value = "2017-02-06T07:18:43Z"
app = pacman_mirrors.PacmanMirrors()
app.config["config_file"] = "conf/pacman-mirrors.conf"
app.config_file = "conf/pacman-mirrors.conf"
mock_data = "date=2017-02-06T07:18:43Z"
assert app.get_mirror_branch_timestamp(mock_data) == "2017-02-06T07:18:43Z"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment