MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime / p2_cli_serve_authority_and_scheme

Function p2_cli_serve_authority_and_scheme

tests/all/cli_tests.rs:2079–2107  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2077
2078 #[tokio::test]
2079 async fn p2_cli_serve_authority_and_scheme() -> Result<()> {
2080 let server = WasmtimeServe::new(P2_CLI_SERVE_AUTHORITY_AND_SCHEME_COMPONENT, |cmd| {
2081 cmd.arg("-Scli");
2082 })?;
2083
2084 let resp = server
2085 .send_request(
2086 hyper::Request::builder()
2087 .uri("/")
2088 .header("Host", "localhost")
2089 .body(String::new())
2090 .context("failed to make request")?,
2091 )
2092 .await?;
2093 assert!(resp.status().is_success());
2094
2095 let resp = server
2096 .send_request(
2097 hyper::Request::builder()
2098 .method("CONNECT")
2099 .uri("http://localhost/")
2100 .body(String::new())
2101 .context("failed to make request")?,
2102 )
2103 .await?;
2104 assert!(resp.status().is_success());
2105
2106 Ok(())
2107 }
2108
2109 #[test]
2110 fn p2_cli_argv0() -> Result<()> {

Callers

nothing calls this directly

Calls 9

OkFunction · 0.85
bodyMethod · 0.80
methodMethod · 0.80
newFunction · 0.50
builderFunction · 0.50
argMethod · 0.45
send_requestMethod · 0.45
contextMethod · 0.45
headerMethod · 0.45

Tested by

no test coverage detected