def test_upload(self): runner = MockRunner() runner.output = "arepo: myurl" builder = ConanMultiPackager(username="******", channel="testing", reference="Hello/0.1", password="******", upload="myurl", visual_versions=[], gcc_versions=[], apple_clang_versions=[], runner=runner, conan_api=self.conan_api, remotes="myurl, otherurl", platform_info=platform_mock_for("Darwin"), ci_manager=self.ci_manager) builder.add_common_builds() builder.run() # Duplicated upload remote puts upload repo first (in the remotes order) self.assertEqual(self.conan_api.calls[1].args[0], 'upload_repo') self.assertEqual(self.conan_api.calls[3].args[0], 'remote1') # Now check that the upload remote order is preserved if we specify it in the remotes runner = MockRunner() self.conan_api = MockConanAPI() builder = ConanMultiPackager(username="******", channel="testing", reference="Hello/0.1", password="******", upload="myurl", visual_versions=[], gcc_versions=[], apple_clang_versions=[], runner=runner, conan_api=self.conan_api, remotes="otherurl, myurl, moreurl", platform_info=platform_mock_for("Darwin"), ci_manager=self.ci_manager) builder.add_common_builds() builder.run() self.assertEqual(self.conan_api.calls[1].args[0], 'remote0') self.assertEqual(self.conan_api.calls[3].args[0], 'upload_repo') self.assertEqual(self.conan_api.calls[5].args[0], 'remote2') runner = MockRunner() self.conan_api = MockConanAPI() builder = ConanMultiPackager(username="******", channel="testing", reference="Hello/0.1", password="******", upload="myurl", visual_versions=[], gcc_versions=[], apple_clang_versions=[], runner=runner, conan_api=self.conan_api, remotes="otherurl", platform_info=platform_mock_for("Darwin"), ci_manager=self.ci_manager) builder.add_common_builds() builder.run() self.assertEqual(self.conan_api.calls[1].args[0], 'remote0') self.assertEqual(self.conan_api.calls[3].args[0], 'upload_repo')
def test_remotes(self): runner = MockRunner() builder = ConanMultiPackager(username="******", remotes=["url1", "url2"], runner=runner, conan_api=self.conan_api, reference="lib/1.0@lasote/mychannel", ci_manager=self.ci_manager) builder.add({}, {}, {}, {}) builder.run_builds() self.assertEquals(self.conan_api.calls[1].args[1], "url1") self.assertEquals(self.conan_api.calls[1].kwargs["insert"], -1) self.assertEquals(self.conan_api.calls[3].args[1], "url2") self.assertEquals(self.conan_api.calls[3].kwargs["insert"], -1) runner = MockRunner() self.conan_api = MockConanAPI() builder = ConanMultiPackager(username="******", remotes="myurl1", runner=runner, conan_api=self.conan_api, reference="lib/1.0@lasote/mychannel", ci_manager=self.ci_manager) builder.add({}, {}, {}, {}) builder.run_builds() self.assertEquals(self.conan_api.calls[1].args[1], "myurl1") self.assertEquals(self.conan_api.calls[1].kwargs["insert"], -1) # Named remotes, with SSL flag runner = MockRunner() self.conan_api = MockConanAPI() remotes = [("u1", True, "my_cool_name1"), ("u2", False, "my_cool_name2")] builder = ConanMultiPackager(username="******", remotes=remotes, runner=runner, conan_api=self.conan_api, reference="lib/1.0@lasote/mychannel", ci_manager=self.ci_manager) builder.add({}, {}, {}, {}) builder.run_builds() self.assertEquals(self.conan_api.calls[1].args[0], "my_cool_name1") self.assertEquals(self.conan_api.calls[1].args[1], "u1") self.assertEquals(self.conan_api.calls[1].kwargs["insert"], -1) self.assertEquals(self.conan_api.calls[1].kwargs["verify_ssl"], True) self.assertEquals(self.conan_api.calls[3].args[0], "my_cool_name2") self.assertEquals(self.conan_api.calls[3].args[1], "u2") self.assertEquals(self.conan_api.calls[3].kwargs["insert"], -1) self.assertEquals(self.conan_api.calls[3].kwargs["verify_ssl"], False)
def setUp(self): self.runner = MockRunner() self.conan_api = MockConanAPI() self.ci_manager = MockCIManager() self.packager = ConanMultiPackager(username="******", channel="mychannel", runner=self.runner, conan_api=self.conan_api, reference="lib/1.0", ci_manager=self.ci_manager) if "APPVEYOR" in os.environ: del os.environ["APPVEYOR"] if "TRAVIS" in os.environ: del os.environ["TRAVIS"]
def setUp(self): self.runner = MockRunner() self.conan_api = MockConanAPI() self.ci_manager = MockCIManager() self.packager = ConanMultiPackager(["--build missing", "-r conan.io"], "lasote", "mychannel", runner=self.runner, conan_api=self.conan_api, reference="lib/1.0", ci_manager=self.ci_manager) if "APPVEYOR" in os.environ: del os.environ["APPVEYOR"] if "TRAVIS" in os.environ: del os.environ["TRAVIS"]