Skip to content

Commit

Permalink
test: add tests for py-rattler MatchSpec channel parsing (#870)
Browse files Browse the repository at this point in the history
  • Loading branch information
cisaacstern authored Sep 23, 2024
1 parent 7e78b4b commit 4ffc20b
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions py-rattler/tests/unit/test_matchspec.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
from rattler import MatchSpec


def test_parse_channel_from_canonical_name() -> None:
m = MatchSpec("conda-forge::python[version=3.9]")
assert m.channel is not None
assert m.channel.name == "conda-forge"
assert m.channel.base_url == "https://conda.anaconda.org/conda-forge/"


def test_parse_channel_from_url() -> None:
m = MatchSpec("https://conda.anaconda.org/conda-forge::python[version=3.9]")
assert m.channel is not None
assert m.channel.name == "conda-forge"
assert m.channel.base_url == "https://conda.anaconda.org/conda-forge/"

0 comments on commit 4ffc20b

Please sign in to comment.