mirror of
https://github.com/astral-sh/uv
synced 2026-01-21 05:20:09 -05:00
Fix incorrect test token_native_auth_realm (#17424)
The state was leaking in from another test case here. Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -407,17 +407,22 @@ fn token_native_auth_realm() -> Result<()> {
|
||||
.arg("public")
|
||||
.env(EnvVars::UV_PREVIEW_FEATURES, "native-auth")
|
||||
.status()?;
|
||||
context
|
||||
.auth_logout()
|
||||
.arg("pypi-proxy.fly.dev")
|
||||
.env(EnvVars::UV_PREVIEW_FEATURES, "native-auth")
|
||||
.status()?;
|
||||
|
||||
// Without persisted credentials
|
||||
uv_snapshot!(context.auth_token()
|
||||
.arg("pypi-proxy.fly.dev")
|
||||
.env(EnvVars::UV_PREVIEW_FEATURES, "native-auth"), @r"
|
||||
success: true
|
||||
exit_code: 0
|
||||
success: false
|
||||
exit_code: 2
|
||||
----- stdout -----
|
||||
heron
|
||||
|
||||
----- stderr -----
|
||||
error: Failed to fetch credentials for https://pypi-proxy.fly.dev/
|
||||
");
|
||||
|
||||
// Without persisted credentials (with a username in the request)
|
||||
@@ -479,28 +484,28 @@ fn token_native_auth_realm() -> Result<()> {
|
||||
----- stderr -----
|
||||
");
|
||||
|
||||
// Without the username
|
||||
// Without the username (defaults to __token__ which wasn't stored)
|
||||
uv_snapshot!(context.auth_token()
|
||||
.arg("pypi-proxy.fly.dev")
|
||||
.env(EnvVars::UV_PREVIEW_FEATURES, "native-auth"), @r"
|
||||
success: true
|
||||
exit_code: 0
|
||||
success: false
|
||||
exit_code: 2
|
||||
----- stdout -----
|
||||
heron
|
||||
|
||||
----- stderr -----
|
||||
error: Failed to fetch credentials for https://pypi-proxy.fly.dev/
|
||||
");
|
||||
|
||||
// Without the username
|
||||
// Without the username (defaults to __token__ which wasn't stored)
|
||||
uv_snapshot!(context.auth_token()
|
||||
.arg("https://pypi-proxy.fly.dev/basic-auth/simple")
|
||||
.env(EnvVars::UV_PREVIEW_FEATURES, "native-auth"), @r"
|
||||
success: true
|
||||
exit_code: 0
|
||||
success: false
|
||||
exit_code: 2
|
||||
----- stdout -----
|
||||
heron
|
||||
|
||||
----- stderr -----
|
||||
error: Failed to fetch credentials for https://pypi-proxy.fly.dev/basic-auth/simple
|
||||
");
|
||||
|
||||
// With a mismatched username
|
||||
|
||||
Reference in New Issue
Block a user