MCPcopy Create free account
hub / github.com/ClickHouse/clickhouse-rs / test_https_error_on_missing_feature

Function test_https_error_on_missing_feature

tests/it/https_errors.rs:5–29  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

3
4#[tokio::test]
5async fn test_https_error_on_missing_feature() {
6 check_cloud_test_env!();
7 let valid_token = require_env_var("CLICKHOUSE_CLOUD_JWT_ACCESS_TOKEN");
8 let client = Client::default()
9 .with_url(get_cloud_url())
10 .with_access_token(valid_token);
11 let result = client
12 .query("SELECT 42")
13 .fetch_one::<u8>()
14 .await
15 .err()
16 .map(|e| e.to_string())
17 .expect("expected a TLS Error, got Ok instead");
18
19 for fragment in [
20 "invalid URL, scheme is not http",
21 "HTTPS",
22 "`native-tls` or `rustls-tls`",
23 ] {
24 assert!(
25 result.contains(fragment),
26 "TLS error message should contain `{fragment}`"
27 );
28 }
29}

Callers

nothing calls this directly

Calls 6

require_env_varFunction · 0.85
defaultFunction · 0.85
get_cloud_urlFunction · 0.85
with_access_tokenMethod · 0.80
with_urlMethod · 0.80
queryMethod · 0.45

Tested by

no test coverage detected