Skip to content
Snippets Groups Projects
Commit 6a237aee authored by Frede H's avatar Frede H :speech_balloon:
Browse files

updated test

parent 8bfa2b8a
No related branches found
No related tags found
No related merge requests found
......@@ -112,6 +112,50 @@ class TestPacmanMirrors(unittest.TestCase):
else:
app.build_common_mirror_list()
@patch("os.getuid")
@patch.object(configfn, "build_config")
def test_full_run_rank(self, mock_build_config, mock_os_getuid):
"""TEST: pacman-mirrors -c all -m random"""
mock_os_getuid.return_value = 0
mock_build_config.return_value = {
"branch": "stable",
"branches": conf.BRANCHES,
"config_file": conf.CONFIG_FILE,
"custom_file": conf.CUSTOM_FILE,
"fallback_file": conf.FALLBACK,
"method": "rank",
"mirror_dir": conf.MIRROR_DIR,
"mirror_file": conf.MIRROR_FILE,
"mirror_list": conf.MIRROR_LIST,
"no_update": False,
"only_country": [],
"repo_arch": conf.REPO_ARCH,
"status_file": conf.STATUS_FILE,
"url_mirrors_json": conf.URL_MIRROR_JSON,
"url_status_json": conf.URL_STATUS_JSON
}
with unittest.mock.patch("sys.argv",
["pacman-mirrors",
"-c", "all"]):
app = PacmanMirrors()
app.config = configfn.build_config()
filefn.dir_must_exist(app.config["mirror_dir"])
app.command_line_parse()
app.load_all_mirrors()
# network check
app.network = httpfn.ping_host("google.com", 3)
# all methods is available
if app.network:
httpfn.update_mirrors(app.config)
# actual generation
if app.fasttrack:
app.build_fasttrack_mirror_list(app.fasttrack)
else:
if app.interactive:
app.build_interactive_mirror_list()
else:
app.build_common_mirror_list()
def tearDown(self):
"""Tear down"""
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