Add test coverage for `uv python install` with invalid requests (#8708)

This commit is contained in:
Zanie Blue 2024-10-30 16:38:47 -05:00 committed by GitHub
parent 893257bb0b
commit 47eb66b138
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 35 additions and 0 deletions

View File

@ -250,3 +250,38 @@ fn python_install_freethreaded() {
- cpython-3.13.0+freethreaded-[PLATFORM]
"###);
}
#[test]
fn python_install_invalid_request() {
let context: TestContext = TestContext::new_with_versions(&[]).with_filtered_python_keys();
// Request something that is not a Python version
uv_snapshot!(context.filters(), context.python_install().arg("foobar"), @r###"
success: false
exit_code: 2
----- stdout -----
----- stderr -----
error: Cannot download managed Python for request: executable name `foobar`
"###);
// Request a version we don't have a download for
uv_snapshot!(context.filters(), context.python_install().arg("3.8.0"), @r###"
success: false
exit_code: 2
----- stdout -----
----- stderr -----
error: No download found for request: cpython-3.8.0-[PLATFORM]
"###);
// Request a version we don't have a download for mixed with one we do
uv_snapshot!(context.filters(), context.python_install().arg("3.8.0").arg("3.12"), @r###"
success: false
exit_code: 2
----- stdout -----
----- stderr -----
error: No download found for request: cpython-3.8.0-[PLATFORM]
"###);
}