From c3cb46b8c174d02e621d791623ca14e1c56e05fb Mon Sep 17 00:00:00 2001 From: ThetaDev Date: Fri, 22 Mar 2024 15:02:45 +0100 Subject: [PATCH] test: fix channel_tab_not_found test --- tests/youtube.rs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/tests/youtube.rs b/tests/youtube.rs index b528385..a7a4391 100644 --- a/tests/youtube.rs +++ b/tests/youtube.rs @@ -1169,10 +1169,16 @@ async fn channel_tab_not_found(#[case] tab: ChannelVideoTab, rp: RustyPipe) { let channel = rp .query() .channel_videos_tab("UCGiJh0NZ52wRhYKYnuZI08Q", tab) - .await - .unwrap(); + .await; - assert!(channel.content.is_empty(), "got: {:?}", channel.content); + // YouTube removed empty tabs from the menu, so they may return no data + match channel { + Ok(channel) => assert!(channel.content.is_empty(), "got: {:?}", channel.content), + Err(err) => assert!( + matches!(err, Error::Extraction(ExtractionError::NotFound { .. })), + "got: {err}" + ), + } } #[rstest]