Add cli test

This commit is contained in:
Thomas Zahner 2025-06-11 11:11:19 +02:00
parent f0a4b3a5a8
commit e59456b96e

View file

@ -1213,6 +1213,26 @@ mod cli {
Ok(())
}
#[tokio::test]
async fn test_accept_overrides_defaults_not_additive() -> Result<()> {
let mock_server_200 = mock_server!(StatusCode::OK);
let mut cmd = main_command();
cmd.arg("--accept")
.arg("404") // ONLY accept 404 - should reject 200 as we overwrite the default
.arg("-")
.write_stdin(mock_server_200.uri())
.assert()
.failure()
.code(2)
.stdout(contains(format!(
r#"[200] {}/ | Rejected status code (this depends on your "accept" configuration): OK"#,
mock_server_200.uri()
)));
Ok(())
}
#[tokio::test]
async fn test_skip_cache_unsupported() -> Result<()> {
let base_path = fixtures_path().join("cache");