diff options
| author | DanConwayDev <DanConwayDev@protonmail.com> | 2025-12-01 14:31:32 +0000 |
|---|---|---|
| committer | DanConwayDev <DanConwayDev@protonmail.com> | 2025-12-01 15:22:38 +0000 |
| commit | d2ac69816567f092fe0d4661723bc43778cb481b (patch) | |
| tree | e8b51b61a6a7b0ab1a214adebe4e237143b01f0b /tests/cors.rs | |
| parent | 7a78815e29b01c83f3d0ec195ba717a2eba8cd37 (diff) | |
fix cargo clippy and fmt warnings
Diffstat (limited to 'tests/cors.rs')
| -rw-r--r-- | tests/cors.rs | 31 |
1 files changed, 1 insertions, 30 deletions
diff --git a/tests/cors.rs b/tests/cors.rs index a27c145..b5a0a87 100644 --- a/tests/cors.rs +++ b/tests/cors.rs | |||
| @@ -55,39 +55,10 @@ macro_rules! isolated_cors_test { | |||
| 55 | }; | 55 | }; |
| 56 | } | 56 | } |
| 57 | 57 | ||
| 58 | /// Macro for CORS tests that need git_data_dir (the full integration test) | ||
| 59 | macro_rules! isolated_cors_test_with_repo { | ||
| 60 | ($test_name:ident) => { | ||
| 61 | #[tokio::test] | ||
| 62 | async fn $test_name() { | ||
| 63 | let relay = TestRelay::start().await; | ||
| 64 | let config = AuditConfig::ci(); | ||
| 65 | let client = AuditClient::new(relay.url(), config) | ||
| 66 | .await | ||
| 67 | .expect("Failed to create audit client"); | ||
| 68 | |||
| 69 | let result = CorsTests::$test_name( | ||
| 70 | &client, | ||
| 71 | &relay.domain(), | ||
| 72 | ) | ||
| 73 | .await; | ||
| 74 | |||
| 75 | relay.stop().await; | ||
| 76 | |||
| 77 | assert!( | ||
| 78 | result.passed, | ||
| 79 | "{} failed: {}", | ||
| 80 | stringify!($test_name), | ||
| 81 | result.error.as_deref().unwrap_or("unknown error") | ||
| 82 | ); | ||
| 83 | } | ||
| 84 | }; | ||
| 85 | } | ||
| 86 | |||
| 87 | // Generate isolated tests for all CORS tests | 58 | // Generate isolated tests for all CORS tests |
| 88 | isolated_cors_test!(test_cors_allow_origin); | 59 | isolated_cors_test!(test_cors_allow_origin); |
| 89 | isolated_cors_test!(test_cors_allow_methods); | 60 | isolated_cors_test!(test_cors_allow_methods); |
| 90 | isolated_cors_test!(test_cors_allow_headers); | 61 | isolated_cors_test!(test_cors_allow_headers); |
| 91 | isolated_cors_test!(test_cors_options_preflight); | 62 | isolated_cors_test!(test_cors_options_preflight); |
| 92 | 63 | ||
| 93 | isolated_cors_test!(test_cors_on_real_repo); \ No newline at end of file | 64 | isolated_cors_test!(test_cors_on_real_repo); |