Пример #1
0
 def test_full_run_rank(self, mock_build_config, mock_os_getuid):
     """TEST: pacman-mirrors -c all"""
     mock_os_getuid.return_value = 0
     mock_build_config.return_value = test_conf
     with unittest.mock.patch("sys.argv", ["pacman-mirrors", "-c", "all"]):
         app = PacmanMirrors()
         app.config = configFn.setup_config()
         fileFn.create_dir(test_conf["work_dir"])
         cliFn.parse_command_line(app, True)
         httpFn.update_mirror_pool(app.config)
         defaultFn.load_default_mirror_pool(app)
         common.build_mirror_list(app)
Пример #2
0
 def run(self):
     """
     Run
     # Setup config: retunrs the config dictionary and true/false on custom
     # Parse commandline
     # i686 check - change branch to x32-$branch
     # sanitize config
     # Check network
     # Update mirror pool
     # Check if mirrorlist is not to be touched - normal exit
     # Handle missing network
     # Load default mirror pool
     # Build mirror list
     """
     (self.config, self.custom) = config_setup.setup_config()
     fileFn.create_dir(self.config["work_dir"])
     cliFn.parse_command_line(self, gtk_available=GTK_AVAILABLE)
     util.i686_check(self, write=True)
     util.aarch64_check(self, write=True)
     if not config_setup.sanitize_config(config=self.config):
         sys.exit(2)
     self.network = httpFn.check_internet_connection(tty=self.tty)
     if self.network:
         httpFn.download_mirror_pool(config=self.config, tty=self.tty, quiet=self.quiet)
     if self.no_mirrorlist:
         sys.exit(0)
     if not self.network:
         if not self.quiet:
             pacman_mirrors.functions.util.internet_message(tty=self.tty)
         self.config["method"] = "random"
         self.fasttrack = False
     """
     # Load configured mirror pool
     """
     defaultFn.load_config_mirror_pool(self)
     """
     # Decide which type of mirrorlist to create
     * Fasttrack
     * Interactive
     * Default
     """
     if self.use_async:
         util.async_disclaimer()
         resp = input()
         if resp.lower() == "n":
             exit(0)
     if self.fasttrack:
         fasttrack.build_mirror_list(self, limit=self.fasttrack)
     elif self.interactive:
         interactive.build_mirror_list(self)
     else:
         common.build_mirror_list(self)
Пример #3
0
 def test_full_run_rank(self,
                        mock_build_config,
                        mock_os_getuid):
     """TEST: pacman-mirrors -c all"""
     mock_os_getuid.return_value = 0
     mock_build_config.return_value = test_conf
     with unittest.mock.patch("sys.argv",
                              ["pacman-mirrors",
                               "-c", "all"]):
         app = PacmanMirrors()
         app.config = configFn.setup_config()
         fileFn.create_dir(test_conf["work_dir"])
         cliFn.parse_command_line(app, True)
         httpFn.update_mirror_pool(app.config)
         defaultFn.load_default_mirror_pool(app)
         common.build_mirror_list(app)
Пример #4
0
 def run(self):
     """
     Run
     # Setup config: retunrs the config dictionary and true/false on custom
     # Parse commandline
     # i686 check - change branch to x32-$branch
     # sanitize config
     # Check network
     # Update mirror pool
     # Check if mirrorlist is not to be touched - normal exit
     # Handle missing network
     # Load default mirror pool
     # Build mirror list
     """
     (self.config, self.custom) = configFn.setup_config()
     fileFn.create_dir(self.config["work_dir"])
     cliFn.parse_command_line(self, GTK_AVAILABLE)
     util.i686_check(self, write=True)
     if not configFn.sanitize_config(self.config):
         sys.exit(2)
     self.network = httpFn.inet_conn_check()
     if self.network:
         httpFn.update_mirror_pool(self.config, quiet=self.quiet)
     if self.no_mirrorlist:
         sys.exit(0)
     if not self.network:
         if not self.quiet:
             pacman_mirrors.functions.util.internet_message()
         self.config["method"] = "random"
         self.fasttrack = False
     """
     # Load configured mirror pool
     """
     defaultFn.load_config_mirror_pool(self)
     """
     # Decide which type of mirrorlist to create
     * Fasttrack
     * Interactive
     * Default
     """
     if self.fasttrack:
         fasttrack.build_mirror_list(self, self.fasttrack)
     elif self.interactive:
         interactive.build_mirror_list(self)
     else:
         common.build_mirror_list(self)
Пример #5
0
 def run(self):
     """
     Run
     # Setup config: retunrs the config dictionary and true/false on custom
     # Parse commandline
     # i686 check - change branch to x32-$branch
     # sanitize config
     # Check network
     # Update mirror pool
     # Check if mirrorlist is not to be touched - normal exit
     # Handle missing network
     # Load default mirror pool
     # Build mirror list
     """
     (self.config, self.custom) = configFn.setup_config()
     fileFn.create_dir(self.config["work_dir"])
     cliFn.parse_command_line(self, GTK_AVAILABLE)
     util.i686_check(self, write=True)
     if not configFn.sanitize_config(self.config):
         sys.exit(2)
     self.network = httpFn.inet_conn_check()
     if self.network:
         httpFn.update_mirror_pool(self.config, quiet=self.quiet)
     if self.no_mirrorlist:
         sys.exit(0)
     if not self.network:
         if not self.quiet:
             pacman_mirrors.functions.util.internet_message()
         self.config["method"] = "random"
         self.fasttrack = False
     """
     # Load configured mirror pool
     """
     defaultFn.load_config_mirror_pool(self)
     """
     # Decide which type of mirrorlist to create
     * Fasttrack
     * Interactive
     * Default
     """
     if self.fasttrack:
         fasttrack.build_mirror_list(self, self.fasttrack)
     elif self.interactive:
         interactive.build_mirror_list(self)
     else:
         common.build_mirror_list(self)