-
Notifications
You must be signed in to change notification settings - Fork 345
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Bind ChannelContext * Deprecate Context() in Python * Remove ChannelContext singleton
- Loading branch information
1 parent
4d70901
commit ecd6de0
Showing
2 changed files
with
106 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import libmambapy | ||
|
||
|
||
def test_context_singleton(): | ||
libmambapy.Context.instance().platform = "mambaos-64" | ||
ctx = libmambapy.Context.instance() | ||
assert ctx.platform == "mambaos-64" | ||
|
||
|
||
def test_channel_context(): | ||
ctx = libmambapy.Context.instance() | ||
|
||
cc = libmambapy.ChannelContext.make_conda_compatible(ctx) | ||
assert cc.make_channel("pkgs/main")[0].url.str() == "https://repo.anaconda.com/pkgs/main" | ||
assert "pkgs/main" in cc.params().custom_channels | ||
chan = cc.params().custom_channels["pkgs/main"] | ||
assert isinstance(cc.has_zst(chan), bool) # Not testing value | ||
|
||
cc = libmambapy.ChannelContext.make_simple(ctx) | ||
assert cc.make_channel("pkgs/main")[0].url.str() == "https://conda.anaconda.org/pkgs/main" | ||
assert len(cc.params().custom_channels) == 0 |