@@ -162,23 +162,27 @@ def test_cli_with_multiple_index_url_and_tilde_req():
162
162
)
163
163
164
164
@pytest .mark .online
165
- def test_cli_with_single_env_var_index_url ():
166
- expected_file = test_env .get_test_loc ("single-url-env-var-expected.json" , must_exist = False )
165
+ def test_cli_with_single_env_var_index_url_flag_override ():
166
+ # Click default is to override env vars via flag as shown here
167
+ expected_file = test_env .get_test_loc ("single-url-env-var-expected.json" , must_exist = True )
167
168
specifier = "zipp==3.8.0"
168
- os .environ ["PYINSP_INDEX_URL" ] = "https://pypi.org/simple"
169
+ os .environ ["PYINSP_INDEX_URL" ] = "https://thirdparty.aboutcode.org/pypi/simple/"
170
+ extra_options = [
171
+ "--index-url" ,
172
+ "https://pypi.org/simple" ,
173
+ ]
169
174
check_specs_resolution (
170
175
specifier = specifier ,
171
176
expected_file = expected_file ,
172
- extra_options = [] ,
177
+ extra_options = extra_options ,
173
178
regen = REGEN_TEST_FIXTURES
174
179
)
175
180
os .unsetenv ("PYINSP_INDEX_URL" )
176
181
177
182
@pytest .mark .online
178
183
def test_cli_with_single_env_var_index_url_except_pypi_simple ():
179
184
expected_file = test_env .get_test_loc (
180
- "single-url-env-var-except-simple-expected.json" , must_exist = False
181
- )
185
+ "single-url-env-var-except-simple-expected.json" , must_exist = True )
182
186
# using flask since it's not present in thirdparty
183
187
specifier = "flask"
184
188
os .environ ["PYINSP_INDEX_URL" ] = "https://thirdparty.aboutcode.org/pypi/simple/"
@@ -190,6 +194,31 @@ def test_cli_with_single_env_var_index_url_except_pypi_simple():
190
194
)
191
195
os .unsetenv ("PYINSP_INDEX_URL" )
192
196
197
+ @pytest .mark .online
198
+ def test_cli_with_multiple_env_var_index_url_and_tilde_req ():
199
+ expected_file = test_env .get_test_loc ("tilde_req-expected.json" , must_exist = True )
200
+ specifier = "zipp~=3.8.0"
201
+ os .environ ["PYINSP_INDEX_URL" ] = "https://pypi.org/simple https://thirdparty.aboutcode.org/pypi/simple/"
202
+ check_specs_resolution (
203
+ specifier = specifier ,
204
+ expected_file = expected_file ,
205
+ extra_options = [],
206
+ regen = REGEN_TEST_FIXTURES ,
207
+ )
208
+ os .unsetenv ("PYINSP_INDEX_URL" )
209
+
210
+ @pytest .mark .online
211
+ def test_cli_with_single_env_var_index_url ():
212
+ expected_file = test_env .get_test_loc ("single-url-env-var-expected.json" , must_exist = True )
213
+ specifier = "zipp==3.8.0"
214
+ os .environ ["PYINSP_INDEX_URL" ] = "https://pypi.org/simple"
215
+ check_specs_resolution (
216
+ specifier = specifier ,
217
+ expected_file = expected_file ,
218
+ extra_options = [],
219
+ regen = REGEN_TEST_FIXTURES
220
+ )
221
+ os .unsetenv ("PYINSP_INDEX_URL" )
193
222
194
223
@pytest .mark .online
195
224
def test_cli_with_environment_marker_and_complex_ranges ():
0 commit comments