use super::*;
use crate::verify_tools::Call;
use std::{fs, path::Path};
#[tokio::test]
async fn inspection_never_pages_output_if_credentials_cannot_be_read() {
let root = crate::test_os::tempdir();
let repo = root.path().join("repo");
let definitions = repo.join(".artifactize");
fs::create_dir_all(&definitions).unwrap();
fs::create_dir(repo.join("input")).unwrap();
fs::write(
definitions.join("fixture.artf"),
r#"artf fixture = { path = "input" }"#,
)
.unwrap();
assert!(inspect::config_check(&repo).unwrap().ok);
let state = root.path().join("state");
let provider = root.path().join("state.provider");
crate::platform::create_private_dir_all(&provider).unwrap();
fs::create_dir(provider.join("providers.json")).unwrap();
let context = runs::Context::new(&repo, Some(&state), Path::new("unused")).unwrap();
let call = Call::parse(
"config_check",
Default::default(),
time::OffsetDateTime::UNIX_EPOCH,
)
.unwrap();
assert!(matches!(
call.execute(&context, CancellationToken::new()).await,
Err(Error::CredentialInventory),
));
}