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:
Zanie Blue
2026-01-12 14:38:50 -06:00
committed by GitHub
parent 6d5e8031d3
commit eca58cbae5

View File

@@ -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