()
| 3 | |
| 4 | #[tokio::test] |
| 5 | async 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 | } |
nothing calls this directly
no test coverage detected