|
19 | 19 | from conda.base.context import context |
20 | 20 | from conda.core.prefix_data import PrefixData |
21 | 21 | from conda.models.version import VersionOrder as Version |
| 22 | +from ruamel.yaml import YAML |
22 | 23 |
|
23 | 24 | from constructor.utils import StandaloneExe, identify_conda_exe |
24 | 25 |
|
@@ -473,6 +474,31 @@ def test_example_extra_files(tmp_path, request): |
473 | 474 | _run_installer(input_path, installer, install_dir, request=request) |
474 | 475 |
|
475 | 476 |
|
| 477 | +def test_example_mirrored_channels(tmp_path, request): |
| 478 | + input_path = _example_path("mirrored_channels") |
| 479 | + for installer, install_dir in create_installer(input_path, tmp_path): |
| 480 | + _run_installer(input_path, installer, install_dir, request=request, uninstall=False) |
| 481 | + |
| 482 | + expected_condarc = { |
| 483 | + "channels": ["conda-forge"], |
| 484 | + "mirrored_channels": { |
| 485 | + "conda-forge": [ |
| 486 | + "https://conda.anaconda.org/conda-forge", |
| 487 | + "https://conda.anaconda.org/mirror1", |
| 488 | + "https://conda.anaconda.org/mirror2", |
| 489 | + ] |
| 490 | + }, |
| 491 | + } |
| 492 | + |
| 493 | + condarc_file = install_dir / ".condarc" |
| 494 | + assert condarc_file.exists() |
| 495 | + |
| 496 | + with open(condarc_file) as file: |
| 497 | + condarc_data = YAML().load(file) |
| 498 | + |
| 499 | + assert condarc_data == expected_condarc |
| 500 | + |
| 501 | + |
476 | 502 | @pytest.mark.xfail( |
477 | 503 | ( |
478 | 504 | CONDA_EXE == StandaloneExe.CONDA |
|
0 commit comments