()
| 1298 | |
| 1299 | #[test] |
| 1300 | fn claim_relay_success() { |
| 1301 | let registry = SupervisorSessionRegistry::new(); |
| 1302 | let (relay_tx, _relay_rx) = oneshot::channel(); |
| 1303 | registry.pending_relays.lock().unwrap().insert( |
| 1304 | "ch-1".to_string(), |
| 1305 | pending_relay("sbx-test", relay_tx, Instant::now()), |
| 1306 | ); |
| 1307 | |
| 1308 | let principal = sandbox_principal("sbx-test"); |
| 1309 | let result = registry.claim_relay("ch-1", Some(&principal)); |
| 1310 | assert!(result.is_ok()); |
| 1311 | assert!(!registry.pending_relays.lock().unwrap().contains_key("ch-1")); |
| 1312 | } |
| 1313 | |
| 1314 | #[test] |
| 1315 | fn claim_relay_rejects_cross_sandbox_principal_without_consuming_channel() { |
nothing calls this directly
no test coverage detected