Add a test of pypi index rendering.
Previously rendering was broken but fixed in Add a test of that
fix.
@@ -25,7 +25,7 @@ def test_clp_no_pypi_option():
options, _ = parser.parse_args(args=[])
assert len(options.indexes) == 1
options, _ = parser.parse_args(args=['--no-pypi'])
- assert len(options.indexes) == 0, '--no-pypi should remove fetchers.'
+ assert len(options.indexes) == 0, '--no-pypi should remove the pypi index.'
def test_clp_pypi_option_duplicate():
@@ -57,6 +57,15 @@ def test_clp_index_option():
assert options2.indexes[1] == 'http://www.example.com'
+def test_clp_index_option_render():
+ with option_parser() as parser:
+ configure_clp_pex_resolution(parser)
+ options, _ = parser.parse_args(args=['--index', 'http://www.example.com'])
+ assert ['https://pypi.org/simple', 'http://www.example.com'] == [
+ str(idx) for idx in options.indexes
+ ]
+
+
def test_clp_build_precedence():
with option_parser() as parser:
configure_clp_pex_resolution(parser)
