Skip to content

Commit

Permalink
Add test
Browse files Browse the repository at this point in the history
  • Loading branch information
Hind-M committed Dec 11, 2024
1 parent 2e82cc9 commit 4eefa1f
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions libmamba/tests/src/specs/test_package_info.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,27 @@ namespace
REQUIRE(pkg.channel == "https://conda.anaconda.org/conda-forge");
}

SECTION("http://localhost:32826/t/1a5eb8d110994feaa53d0d9f8bf13bbb/get/proxy-channel/linux-64/_libgcc_mutex-0.1-conda_forge.tar.bz2#d7c89558ba9fa0495403155b64376d81"
)
{
static constexpr std::string_view url = "http://localhost:32826/t/1a5eb8d110994feaa53d0d9f8bf13bbb/get/proxy-channel/linux-64/_libgcc_mutex-0.1-conda_forge.tar.bz2#d7c89558ba9fa0495403155b64376d81";

auto pkg = PackageInfo::from_url(url).value();

REQUIRE(pkg.name == "_libgcc_mutex");
REQUIRE(pkg.version == "0.1");
REQUIRE(pkg.build_string == "conda_forge");
REQUIRE(pkg.filename == "_libgcc_mutex-0.1-conda_forge.tar.bz2");
REQUIRE(pkg.package_url == url.substr(0, url.rfind('#')));
REQUIRE(pkg.md5 == url.substr(url.rfind('#') + 1));
REQUIRE(pkg.platform == "linux-64");
// Make sure the token is not censored when setting the channel
REQUIRE(
pkg.channel
== "http://localhost:32826/t/1a5eb8d110994feaa53d0d9f8bf13bbb/get/proxy-channel"
);
}

SECTION("https://conda.anaconda.org/conda-forge/linux-64/pkg.conda")
{
static constexpr std::string_view url = "https://conda.anaconda.org/conda-forge/linux-64/pkg.conda";
Expand Down

0 comments on commit 4eefa1f

Please sign in to comment.