🧪 p3: test client native_async + sse_specs wiring
swadhinbiswas committed 2 months ago
96c6ac3
1 parent 576a7be
commit 96c6ac3
1 file changed
+14 -0
Showing 1 changed file+14-0
▼crates/justapi-py/src/test_client.rs
+14-0
| @@ -76,6 +76,18 @@ impl JustAPITestClient { | ||
76 | 76 | let needs_request = Arc::new(needs_request); |
77 | 77 | let native: Vec<bool> = app_ref.native.clone(); |
78 | 78 | let native = Arc::new(native); |
79 | + let native_async: Vec<bool> = app_ref | |
80 | + .handlers | |
81 | + .iter() | |
82 | + .map(|h| { | |
83 | + h.bind(py) | |
84 | + .getattr("_is_native_async") | |
85 | + .and_then(|v| v.extract::<bool>()) | |
86 | + .unwrap_or(false) | |
87 | + }) | |
88 | + .collect(); | |
89 | + let native_async = Arc::new(native_async); | |
90 | + let sse_specs: Arc<Vec<Option<(u64, u64)>>> = Arc::new(app_ref.sse_specs.clone()); | |
79 | 91 | let schema_validators: Vec<Option<justapi_core::validate::CompiledValidator>> = app_ref |
80 | 92 | .schema_jsons |
81 | 93 | .iter() |
| @@ -119,6 +131,8 @@ impl JustAPITestClient { | ||
119 | 131 | app_py, |
120 | 132 | needs_request, |
121 | 133 | native, |
134 | + native_async, | |
135 | + sse_specs, | |
122 | 136 | schema_validators, |
123 | 137 | 50 * 1024 * 1024, |
124 | 138 | ); |
125 | 139 | |