Skip to content

Commit

Permalink
Remove conan-center default remote (#9401)
Browse files Browse the repository at this point in the history
* Remove conan-center default remote

* fix tests
  • Loading branch information
danimtb committed Aug 11, 2021
1 parent f7c5a4e commit c3fc425
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 20 deletions.
2 changes: 0 additions & 2 deletions conans/client/cache/remote_registry.py
Expand Up @@ -112,8 +112,6 @@ def defaults(cls):
result = Remotes()
result._remotes[CONAN_CENTER_REMOTE_NAME] = Remote(CONAN_CENTER_REMOTE_NAME,
"https://center.conan.io", True, False)
result._remotes["conan-center"] = Remote("conan-center", "https://conan.bintray.com", True,
False)
return result

def select(self, remote_name):
Expand Down
24 changes: 6 additions & 18 deletions conans/test/integration/configuration/registry_test.py
Expand Up @@ -67,13 +67,11 @@ def test_add_remove_update(self):
registry.add("local", "http://localhost:9300")
self.assertEqual(list(registry.load_remotes().values()),
[("conancenter", "https://center.conan.io", True, False),
("conan-center", "https://conan.bintray.com", True, False),
("local", "http://localhost:9300", True, False)])
# Add
registry.add("new", "new_url", False)
self.assertEqual(list(registry.load_remotes().values()),
[("conancenter", "https://center.conan.io", True, False),
("conan-center", "https://conan.bintray.com", True, False),
("local", "http://localhost:9300", True, False),
("new", "new_url", False, False)])
with self.assertRaises(ConanException):
Expand All @@ -82,7 +80,6 @@ def test_add_remove_update(self):
registry.update("new", "other_url")
self.assertEqual(list(registry.load_remotes().values()),
[("conancenter", "https://center.conan.io", True, False),
("conan-center", "https://conan.bintray.com", True, False),
("local", "http://localhost:9300", True, False),
("new", "other_url", True, False)])
with self.assertRaises(ConanException):
Expand All @@ -91,15 +88,13 @@ def test_add_remove_update(self):
registry.update("new", "other_url", False)
self.assertEqual(list(registry.load_remotes().values()),
[("conancenter", "https://center.conan.io", True, False),
("conan-center", "https://conan.bintray.com", True, False),
("local", "http://localhost:9300", True, False),
("new", "other_url", False, False)])

# Remove
registry.remove("local")
self.assertEqual(list(registry.load_remotes().values()),
[("conancenter", "https://center.conan.io", True, False),
("conan-center", "https://conan.bintray.com", True, False),
("new", "other_url", False, False)])
with self.assertRaises(ConanException):
registry.remove("new2")
Expand Down Expand Up @@ -145,15 +140,13 @@ def test_remote_none(self):
registry.add("foobar", None)
self.assertEqual(list(registry.load_remotes().values()),
[("conancenter", "https://center.conan.io", True, False),
("conan-center", "https://conan.bintray.com", True, False),
("foobar", None, True, False)])
self.assertIn("WARN: The URL is empty. It must contain scheme and hostname.", cache._output)
registry.remove("foobar")

registry.update("conan-center", None)
registry.update("conancenter", None)
self.assertEqual(list(registry.load_remotes().values()),
[("conancenter", "https://center.conan.io", True, False),
("conan-center", None, True, False)])
[("conancenter", None, True, False)])
self.assertIn("WARN: The URL is empty. It must contain scheme and hostname.", cache._output)

def test_enable_disable_remotes(self):
Expand All @@ -166,26 +159,21 @@ def test_enable_disable_remotes(self):
registry.set_disabled_state("local", True)
self.assertEqual(list(registry.load_remotes().all_values()),
[("conancenter", "https://center.conan.io", True, False),
("conan-center", "https://conan.bintray.com", True, False),
("local", "http://localhost:9300", True, True)])

self.assertEqual(list(registry.load_remotes().values()),
[("conancenter", "https://center.conan.io", True, False),
("conan-center", "https://conan.bintray.com", True, False)])
[("conancenter", "https://center.conan.io", True, False)])

registry.set_disabled_state("conan-center", True)
registry.set_disabled_state("conancenter", True)
self.assertEqual(list(registry.load_remotes().all_values()),
[("conancenter", "https://center.conan.io", True, False),
("conan-center", "https://conan.bintray.com", True, True),
[("conancenter", "https://center.conan.io", True, True),
("local", "http://localhost:9300", True, True)])

self.assertEqual(list(registry.load_remotes().values()),
[("conancenter", "https://center.conan.io", True, False)])
self.assertEqual(list(registry.load_remotes().values()), [])

registry.set_disabled_state("*", False)
self.assertEqual(list(registry.load_remotes().values()),
[("conancenter", "https://center.conan.io", True, False),
("conan-center", "https://conan.bintray.com", True, False),
("local", "http://localhost:9300", True, False)])

registry.set_disabled_state("*", True)
Expand Down

0 comments on commit c3fc425

Please sign in to comment.