def method_called_test(self):

        save(
            os.path.join(self.client_cache.package(self.package_reference),
                         CONANINFO), "asdasd")
        manifest = FileTreeManifest.create(
            self.client_cache.package(self.package_reference))
        save(
            os.path.join(self.client_cache.package(self.package_reference),
                         CONAN_MANIFEST), str(manifest))

        self.assertFalse(self.remote_client.upload_package.called)
        self.manager.upload_package(self.package_reference,
                                    Remote("other", "url", True), 1, 0)
        self.assertTrue(self.remote_client.upload_package.called)

        self.assertFalse(self.remote_client.get_conan_digest.called)
        self.manager.get_conan_digest(self.conan_reference,
                                      Remote("other", "url", True))
        self.assertTrue(self.remote_client.get_conan_digest.called)

        self.assertFalse(self.remote_client.get_recipe.called)
        self.manager.get_recipe(self.conan_reference, temp_folder(),
                                Remote("other", "url", True))
        self.assertTrue(self.remote_client.get_recipe.called)

        self.assertFalse(self.remote_client.get_package.called)
        self.manager.get_package(self.package_reference, temp_folder(),
                                 Remote("other", "url", True))
        self.assertTrue(self.remote_client.get_package.called)
Exemple #2
0
 def _check(self, install_path):
     settings_path = self.client.client_cache.settings_path
     self.assertEqual(load(settings_path).splitlines(), settings_yml.splitlines())
     registry_path = self.client.client_cache.registry
     registry = RemoteRegistry(registry_path, TestBufferConanOutput())
     self.assertEqual(registry.remotes,
                      [Remote("myrepo1", "https://myrepourl.net", False),
                       Remote("my-repo-2", "https://myrepo2.com", True),
                       ])
     self.assertEqual(registry.refs, {"MyPkg/0.1@user/channel": "my-repo-2"})
     self.assertEqual(sorted(os.listdir(self.client.client_cache.profiles_path)),
                      sorted(["default", "linux", "windows"]))
     self.assertEqual(load(os.path.join(self.client.client_cache.profiles_path, "linux")).splitlines(),
                      linux_profile.splitlines())
     self.assertEqual(load(os.path.join(self.client.client_cache.profiles_path, "windows")).splitlines(),
                      win_profile.splitlines())
     conan_conf = ConanClientConfigParser(self.client.client_cache.conan_conf_path)
     self.assertEqual(conan_conf.get_item("log.run_to_output"), "False")
     self.assertEqual(conan_conf.get_item("log.run_to_file"), "False")
     self.assertEqual(conan_conf.get_item("log.level"), "10")
     self.assertEqual(conan_conf.get_item("general.compression_level"), "6")
     self.assertEqual(conan_conf.get_item("general.sysrequires_sudo"), "True")
     self.assertEqual(conan_conf.get_item("general.cpu_count"), "1")
     self.assertEqual(conan_conf.get_item("general.config_install"), install_path)
     self.assertEqual(conan_conf.get_item("proxies.no_proxy"), "mylocalhost")
     self.assertEqual(conan_conf.get_item("proxies.https"), "None")
     self.assertEqual(conan_conf.get_item("proxies.http"), "http://*****:*****@10.10.1.10:3128/")
     self.assertEqual("#Custom pylint",
                      load(os.path.join(self.client.client_cache.conan_folder, "pylintrc")))
Exemple #3
0
    def remote_selection_test(self):
        # If no remote is specified will look to first
        self.assertRaises(NotFoundException, self.manager.upload_conan,
                          self.conan_reference, Remote("other", "url"))

        # If remote is specified took it
        self.assertRaises(NotFoundException, self.manager.upload_conan,
                          self.conan_reference, Remote("other", "url"))
Exemple #4
0
    def remote_selection_test(self):
        save(os.path.join(self.client_cache.export(self.conan_reference), CONANFILE), "asdasd")
        save(os.path.join(self.client_cache.export(self.conan_reference), CONAN_MANIFEST), "asdasd")

        # If no remote is specified will look to first
        self.assertRaises(NotFoundException, self.manager.upload_conan, self.conan_reference, None)

        # If remote is specified took it
        self.assertRaises(NotFoundException,
                          self.manager.upload_conan, self.conan_reference, Remote("other", "url"))
Exemple #5
0
    def method_called_test(self):
        self.assertFalse(self.remote_client.upload_package.called)
        self.manager.upload_package(self.package_reference,
                                    Remote("other", "url"))
        self.assertTrue(self.remote_client.upload_package.called)

        self.assertFalse(self.remote_client.get_conan_digest.called)
        self.manager.get_conan_digest(self.conan_reference,
                                      Remote("other", "url"))
        self.assertTrue(self.remote_client.get_conan_digest.called)

        self.assertFalse(self.remote_client.get_conanfile.called)
        self.manager.get_conanfile(self.conan_reference,
                                   Remote("other", "url"))
        self.assertTrue(self.remote_client.get_conanfile.called)

        self.assertFalse(self.remote_client.get_package.called)
        self.manager.get_package(self.package_reference,
                                 Remote("other", "url"))
        self.assertTrue(self.remote_client.get_package.called)