Update PackageIndex tests for the addition of TestPyPI
@@ -12,10 +12,13 @@ class TestPackageIndex(object):
def test_gives_right_urls(self):
url = "https://mypypi.internal/path/"
- pack_index = index.PackageIndex(url)
+ file_storage_domain = "files.mypypi.internal"
+ pack_index = index.PackageIndex(url, file_storage_domain)
- assert pack_index.netloc == "mypypi.internal"
assert pack_index.url == url
+ assert pack_index.file_storage_domain == file_storage_domain
+
+ assert pack_index.netloc == "mypypi.internal"
assert pack_index.simple_url == url + "simple"
assert pack_index.pypi_url == url + "pypi"
@@ -26,6 +29,16 @@ class TestPackageIndex(object):
assert pack_index.url == "https://pypi.org/"
assert pack_index.simple_url == "https://pypi.org/simple"
assert pack_index.pypi_url == "https://pypi.org/pypi"
+ assert pack_index.file_storage_domain == "files.pythonhosted.org"
+
+ def test_TestPyPI_urls_are_correct(self):
+ pack_index = index.TestPyPI
+
+ assert pack_index.netloc == "test.pypi.org"
+ assert pack_index.url == "https://test.pypi.org/"
+ assert pack_index.simple_url == "https://test.pypi.org/simple"
+ assert pack_index.pypi_url == "https://test.pypi.org/pypi"
+ assert pack_index.file_storage_domain == "test-files.pythonhosted.org"
class TestInstallationCandidate(object):
