Skip to content

Commit 8f12fe5

Browse files
committed
Test login error with non-token provider
1 parent 51346ad commit 8f12fe5

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

tests/testsuite/credential_process.rs

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,30 @@ You may press ctrl-c [..]
8787
.run();
8888
}
8989

90+
#[cargo_test]
91+
fn credential_provider_auth_failure() {
92+
let _reg = registry::RegistryBuilder::new()
93+
.http_index()
94+
.auth_required()
95+
.alternative()
96+
.no_configure_token()
97+
.credential_provider(&["cargo:token-from-stdout", "true"])
98+
.build();
99+
100+
cargo_process("install libc --registry=alternative")
101+
.with_status(101)
102+
.with_stderr_data(str![[r#"
103+
[UPDATING] `alternative` index
104+
[ERROR] token rejected for `alternative`, please run `cargo login --registry alternative`
105+
106+
Caused by:
107+
failed to get successful HTTP response from [..]
108+
body:
109+
[..]
110+
"#]])
111+
.run();
112+
}
113+
90114
#[cargo_test]
91115
fn basic_unsupported() {
92116
// Non-action commands don't support login/logout.

0 commit comments

Comments
 (0)