Beispiel #1
0
    def insert_test(self):
        tmp_folder = temp_folder()
        f = os.path.join(tmp_folder, "remotes.json")
        save(f, """
{
 "remotes": [
  {
   "url": "https://server.conan.io",
   "verify_ssl": true,
   "name": "conan.io"
  }
 ]
}
""")
        output = TestBufferConanOutput()
        cache = ClientCache(tmp_folder, output)
        registry = RemoteRegistry(cache, output)
        registry.add("repo1", "url1", True, insert=0)
        self.assertEqual(list(registry.load_remotes().values()), [Remote("repo1", "url1", True, False),
                         Remote("conan.io", "https://server.conan.io", True, False)])
        registry.add("repo2", "url2", True, insert=1)
        self.assertEqual(list(registry.load_remotes().values()), [Remote("repo1", "url1", True, False),
                         Remote("repo2", "url2", True, False),
                         Remote("conan.io", "https://server.conan.io", True, False)])
        registry.add("repo3", "url3", True, insert=5)
        self.assertEqual(list(registry.load_remotes().values()), [Remote("repo1", "url1", True, False),
                         Remote("repo2", "url2", True, False),
                         Remote("conan.io", "https://server.conan.io", True, False),
                         Remote("repo3", "url3", True, False)])
Beispiel #2
0
 def retro_compatibility_test(self):
     folder = temp_folder()
     f = os.path.join(folder, ".conan", "registry.txt")
     save(f, "conan.io https://server.conan.io")  # Without SSL parameter
     cache = ClientCache(folder, TestBufferConanOutput())
     migrate_registry_file(cache, TestBufferConanOutput())
     registry = RemoteRegistry(cache)
     self.assertEqual(list(registry.load_remotes().values()),
                      [("conan.io", "https://server.conan.io", True)])
Beispiel #3
0
    def retro_compatibility_test(self):
        folder = temp_folder()
        f = os.path.join(folder, "registry.txt")
        save(f, textwrap.dedent("""conan.io https://server.conan.io

            pkg/0.1@user/testing some_remote
            """))
        output = TestBufferConanOutput()
        cache = ClientCache(folder, output)
        migrate_registry_file(cache, output)
        registry = RemoteRegistry(cache, output)
        self.assertEqual(list(registry.load_remotes().values()),
                         [("conan.io", "https://server.conan.io", True, False)])