Skip to content
Snippets Groups Projects
Commit dc6dd0b2 authored by FH's avatar FH
Browse files

geoip tests moved to own file

parent 8f2f2d28
No related branches found
No related tags found
No related merge requests found
...@@ -42,40 +42,6 @@ class TestPacmanMirrors(unittest.TestCase): ...@@ -42,40 +42,6 @@ class TestPacmanMirrors(unittest.TestCase):
else: else:
app.build_common_mirror_list() app.build_common_mirror_list()
# @patch("os.getuid")
# @patch.object(HttpFn, "get_geoip_country")
# def test_geoip_available(self, mock_geoip, mock_os_getuid):
# """Geoip mirror country IS avaiable"""
# mock_os_getuid.return_value = 0
# mock_geoip.return_value = "France"
# with unittest.mock.patch("sys.argv",
# ["pacman-mirrors",
# "--geoip"]):
# app = PacmanMirrors()
# app.config = app.build_config()
# app.command_line_parse()
#
# country = HttpFn.get_geoip_country()
# assert country == "Denmark"
# @patch("os.getuid")
# @patch.object(HttpFn, "get_geoip_country")
# def test_geoip_not_available(self, mock_geoip, mock_os_getuid):
# """Geoip mirror country IS NOT available"""
# mock_os_getuid.return_value = 0
# mock_geoip.return_value = "Antarctica"
# with unittest.mock.patch("sys.argv",
# ["pacman-mirrors",
# "-g",
# "--geoip"]):
# app = PacmanMirrors()
# app.config = app.build_config()
# app.command_line_parse()
# app.load_all_mirrors()
# app.config["only_country"] = []
#
# assert app.config["only_country"] == app.mirrors.countrylist
def tearDown(self): def tearDown(self):
"""Tear down""" """Tear down"""
pass pass
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment