def get_conan_api_v1(self): user_io = MockedUserIO(self.users) conan = Conan(cache_folder=self.cache_folder, user_io=user_io, http_requester=self._http_requester, runner=self.runner) return conan
def check_upload_confirm_question_test(self): user_io = MockedUserIO({"default": [("lasote", "mypass")]}, out=TestBufferConanOutput()) files = cpp_hello_conan_files("Hello1", "1.2.1") self.client.save(files) self.client.run("export . frodo/stable") user_io.request_string = lambda _: "y" self.client.run("upload Hello*", user_io=user_io) self.assertIn("Uploading Hello1/1.2.1@frodo/stable", self.client.out) files = cpp_hello_conan_files("Hello2", "1.2.1") self.client.save(files) self.client.run("export . frodo/stable") user_io.request_string = lambda _: "n" self.client.run("upload Hello*", user_io=user_io) self.assertNotIn("Uploading Hello2/1.2.1@frodo/stable", self.client.out)
def get_conan_api_v2(self): user_io = MockedUserIO(self.users, out=sys.stderr) conan = ConanAPIV2(cache_folder=self.cache_folder, quiet=False, user_io=user_io, http_requester=self._http_requester, runner=self.runner) return conan
def get_conan_api_v1(self, user_io=None): if user_io: self.out = user_io.out else: self.out = TestBufferConanOutput() user_io = user_io or MockedUserIO(self.users, out=self.out) conan = Conan(cache_folder=self.cache_folder, output=self.out, user_io=user_io, http_requester=self._http_requester, runner=self.runner) return conan