Skip to content

Commit 790dadf

Browse files
committed
feat: add test
1 parent 8d3bab2 commit 790dadf

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/robust_provider.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -426,4 +426,19 @@ mod tests {
426426

427427
assert!(matches!(result, Err(Error::Timeout)));
428428
}
429+
430+
#[tokio::test]
431+
async fn test_http_provider_skipped_when_pubsub_required() {
432+
let provider = test_provider(100, 3, 10);
433+
434+
let result: Result<(), Error> = provider
435+
.retry_with_total_timeout(
436+
|_| async { Ok(()) },
437+
true, // require pubsub
438+
)
439+
.await;
440+
441+
// Should get PubSubNotSupported error
442+
assert!(matches!(result, Err(Error::PubSubNotSupported)));
443+
}
429444
}

0 commit comments

Comments
 (0)