From 9a07958478defa0f5d8b26ca9217a3e36d113c47 Mon Sep 17 00:00:00 2001 From: jbesraa Date: Thu, 9 Jan 2025 17:40:14 +0200 Subject: [PATCH] Add `Sniffer::includes_message_type` fn --- roles/tests-integration/lib/sniffer.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/roles/tests-integration/lib/sniffer.rs b/roles/tests-integration/lib/sniffer.rs index 72abc8e1e..1ffd6f289 100644 --- a/roles/tests-integration/lib/sniffer.rs +++ b/roles/tests-integration/lib/sniffer.rs @@ -456,6 +456,21 @@ impl Sniffer { sleep(Duration::from_secs(1)).await; } } + + pub async fn includes_message_type( + &self, + message_direction: MessageDirection, + message_type: u8, + ) -> bool { + match message_direction { + MessageDirection::ToDownstream => { + self.messages_from_upstream.has_message_type(message_type) + } + MessageDirection::ToUpstream => { + self.messages_from_downstream.has_message_type(message_type) + } + } + } } // Utility macro to assert that the downstream and upstream roles have sent specific messages.