upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/tests/cors.rs
diff options
context:
space:
mode:
authorDanConwayDev <DanConwayDev@protonmail.com>2025-12-01 14:31:32 +0000
committerDanConwayDev <DanConwayDev@protonmail.com>2025-12-01 15:22:38 +0000
commitd2ac69816567f092fe0d4661723bc43778cb481b (patch)
treee8b51b61a6a7b0ab1a214adebe4e237143b01f0b /tests/cors.rs
parent7a78815e29b01c83f3d0ec195ba717a2eba8cd37 (diff)
fix cargo clippy and fmt warnings
Diffstat (limited to 'tests/cors.rs')
-rw-r--r--tests/cors.rs31
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)
59macro_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
88isolated_cors_test!(test_cors_allow_origin); 59isolated_cors_test!(test_cors_allow_origin);
89isolated_cors_test!(test_cors_allow_methods); 60isolated_cors_test!(test_cors_allow_methods);
90isolated_cors_test!(test_cors_allow_headers); 61isolated_cors_test!(test_cors_allow_headers);
91isolated_cors_test!(test_cors_options_preflight); 62isolated_cors_test!(test_cors_options_preflight);
92 63
93isolated_cors_test!(test_cors_on_real_repo); \ No newline at end of file 64isolated_cors_test!(test_cors_on_real_repo);