Add test case for HTTPS credentials on direct URL in `uv export` (#13808)

Related to 

- #13799 
- #13792
This commit is contained in:
Zanie Blue 2025-06-03 09:11:13 -05:00 committed by GitHub
parent fd48b8bb78
commit 4cdac77fe9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 35 additions and 1 deletions

View File

@ -1142,7 +1142,7 @@ fn requirements_txt_non_project() -> Result<()> {
#[cfg(feature = "git")]
#[test]
fn requirements_txt_git_credentials() -> Result<()> {
fn requirements_txt_https_git_credentials() -> Result<()> {
let context = TestContext::new("3.12");
let token = decode_token(READ_ONLY_GITHUB_TOKEN);
@ -1174,6 +1174,40 @@ fn requirements_txt_git_credentials() -> Result<()> {
Ok(())
}
#[cfg(feature = "git")]
#[test]
fn requirements_txt_https_credentials() -> Result<()> {
let context = TestContext::new("3.12");
let pyproject_toml = context.temp_dir.child("pyproject.toml");
pyproject_toml.write_str(&formatdoc! {r#"
[project]
name = "project"
version = "0.1.0"
requires-python = ">=3.12"
dependencies = ["iniconfig @ https://public:heron@pypi-proxy.fly.dev/basic-auth/files/packages/ef/a6/62565a6e1cf69e10f5727360368e451d4b7f58beeac6173dc9db836a5b46/iniconfig-2.0.0-py3-none-any.whl"]
"#})?;
context.lock().assert().success();
// The credentials are for a direct URL, and are included in the export
uv_snapshot!(context.filters(), context.export(), @r"
success: true
exit_code: 0
----- stdout -----
# This file was autogenerated by uv via the following command:
# uv export --cache-dir [CACHE_DIR]
iniconfig @ https://public:****@pypi-proxy.fly.dev/basic-auth/files/packages/ef/a6/62565a6e1cf69e10f5727360368e451d4b7f58beeac6173dc9db836a5b46/iniconfig-2.0.0-py3-none-any.whl \
--hash=sha256:b6a85871a79d2e3b22d2d1b94ac2824226a63c6b741c88f7ae975f18b6778374
# via project
----- stderr -----
Resolved 2 packages in [TIME]
");
Ok(())
}
#[test]
fn requirements_txt_non_project_marker() -> Result<()> {
let context = TestContext::new("3.12");