mirror of
https://github.com/Hopiu/lychee.git
synced 2026-03-16 20:50:25 +00:00
Add cli test
This commit is contained in:
parent
f0a4b3a5a8
commit
e59456b96e
1 changed files with 20 additions and 0 deletions
|
|
@ -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");
|
||||
|
|
|
|||
Loading…
Reference in a new issue