Beispiel #1
0
    def _init_collaborators(self, user_io=None):

        output = TestBufferConanOutput()
        self.user_io = user_io or MockedUserIO(self.users, out=output)
        self.cache = ClientCache(self.base_folder, self.storage_folder, output)
        self.runner = TestRunner(output, runner=self.conan_runner)

        # Check if servers are real
        real_servers = False
        for server in self.servers.values():
            if isinstance(server, str) or isinstance(
                    server, ArtifactoryServer):  # Just URI
                real_servers = True
                break

        with tools.environment_append(self.cache.config.env_vars):
            if real_servers:
                requester = requests.Session()
            else:
                if self.requester_class:
                    requester = self.requester_class(self.servers)
                else:
                    requester = TestRequester(self.servers)

            self.requester = ConanRequester(requester, self.cache,
                                            get_request_timeout())

            self.hook_manager = HookManager(self.cache.hooks_path,
                                            get_env("CONAN_HOOKS", list()),
                                            self.user_io.out)

            self.localdb, self.rest_api_client, self.remote_manager = \
                Conan.instance_remote_manager(self.requester, self.cache,
                                              self.user_io, self.hook_manager)
            return output, self.requester
Beispiel #2
0
    def _init_collaborators(self, user_io=None):

        output = TestBufferConanOutput()
        self.user_io = user_io or MockedUserIO(self.users, out=output)

        self.runner = TestRunner(output, runner=self.conan_runner)

        # Check if servers are real
        real_servers = False
        for server in self.servers.values():
            if isinstance(server, str):  # Just URI
                real_servers = True

        with tools.environment_append(self.client_cache.conan_config.env_vars):
            if real_servers:
                requester = requests.Session()
            else:
                if self.requester_class:
                    requester = self.requester_class(self.servers)
                else:
                    requester = TestRequester(self.servers)

            self.requester = ConanRequester(requester, self.client_cache,
                                            get_request_timeout())

            self.localdb, self.rest_api_client, self.remote_manager = Conan.instance_remote_manager(
                self.requester, self.client_cache, self.user_io,
                self.client_version, self.min_server_compatible_version)
            set_global_instances(output, self.requester)
Beispiel #3
0
    def _init_collaborators(self, user_io=None):

        output = TestBufferConanOutput()
        self.user_io = user_io or MockedUserIO(self.users, out=output)

        self.runner = TestRunner(output, runner=self.conan_runner)

        # Check if servers are real
        real_servers = False
        for server in self.servers.values():
            if isinstance(server, str):  # Just URI
                real_servers = True

        with tools.environment_append(self.client_cache.conan_config.env_vars):
            if real_servers:
                requester = requests.Session()
            else:
                if self.requester_class:
                    requester = self.requester_class(self.servers)
                else:
                    requester = TestRequester(self.servers)

            self.requester = ConanRequester(requester, self.client_cache,
                                            get_request_timeout())

            self.localdb, self.rest_api_client, self.remote_manager = Conan.instance_remote_manager(
                                                            self.requester, self.client_cache,
                                                            self.user_io, self.client_version,
                                                            self.min_server_compatible_version)
            set_global_instances(output, self.requester)