ci: skip authenticated tests
This commit is contained in:
parent
75c3746890
commit
51dacf8df2
3 changed files with 97 additions and 151 deletions
229
tests/youtube.rs
229
tests/youtube.rs
|
|
@ -2734,6 +2734,94 @@ async fn isrc_search_languages(rp: RustyPipe) {
|
|||
}
|
||||
}
|
||||
|
||||
mod cookie_auth {
|
||||
use super::*;
|
||||
|
||||
#[rstest]
|
||||
#[tokio::test]
|
||||
async fn history(rp: RustyPipe) {
|
||||
let videos = rp.query().history().await.unwrap();
|
||||
assert_next_history(videos, rp.query(), 100).await;
|
||||
}
|
||||
|
||||
#[rstest]
|
||||
#[tokio::test]
|
||||
async fn history_search(rp: RustyPipe) {
|
||||
let videos = rp.query().history_search("a").await.unwrap();
|
||||
assert_next_history(videos, rp.query(), 5).await;
|
||||
}
|
||||
|
||||
#[rstest]
|
||||
#[tokio::test]
|
||||
async fn subscriptions(rp: RustyPipe) {
|
||||
let channels = rp.query().subscriptions().await.unwrap();
|
||||
assert_next_items(channels, rp.query(), 5).await;
|
||||
}
|
||||
|
||||
#[rstest]
|
||||
#[tokio::test]
|
||||
async fn subscription_feed(rp: RustyPipe) {
|
||||
let videos = rp.query().subscription_feed().await.unwrap();
|
||||
assert_next_items(videos, rp.query(), 50).await;
|
||||
}
|
||||
|
||||
#[rstest]
|
||||
#[tokio::test]
|
||||
async fn liked_videos(rp: RustyPipe) {
|
||||
let videos = rp.query().liked_videos().await.unwrap();
|
||||
assert_next_items(videos.videos, rp.query(), 5).await;
|
||||
}
|
||||
|
||||
#[rstest]
|
||||
#[tokio::test]
|
||||
async fn watch_later(rp: RustyPipe) {
|
||||
let videos = rp.query().watch_later().await.unwrap();
|
||||
assert_next_items(videos.videos, rp.query(), 5).await;
|
||||
}
|
||||
|
||||
#[rstest]
|
||||
#[tokio::test]
|
||||
async fn music_history(rp: RustyPipe) {
|
||||
let tracks = rp.query().music_history().await.unwrap();
|
||||
assert_next_music_history(tracks, rp.query(), 150).await;
|
||||
}
|
||||
|
||||
#[rstest]
|
||||
#[tokio::test]
|
||||
async fn music_saved_artists(rp: RustyPipe) {
|
||||
let artists = rp.query().music_saved_artists().await.unwrap();
|
||||
assert_next_items(artists, rp.query(), 5).await;
|
||||
}
|
||||
|
||||
#[rstest]
|
||||
#[tokio::test]
|
||||
async fn music_saved_albums(rp: RustyPipe) {
|
||||
let albums = rp.query().music_saved_albums().await.unwrap();
|
||||
assert_next_items(albums, rp.query(), 5).await;
|
||||
}
|
||||
|
||||
#[rstest]
|
||||
#[tokio::test]
|
||||
async fn music_saved_tracks(rp: RustyPipe) {
|
||||
let tracks = rp.query().music_saved_tracks().await.unwrap();
|
||||
assert_next_items(tracks, rp.query(), 50).await;
|
||||
}
|
||||
|
||||
#[rstest]
|
||||
#[tokio::test]
|
||||
async fn music_saved_playlists(rp: RustyPipe) {
|
||||
let playlists = rp.query().music_saved_playlists().await.unwrap();
|
||||
assert_next_items(playlists, rp.query(), 5).await;
|
||||
}
|
||||
|
||||
#[rstest]
|
||||
#[tokio::test]
|
||||
async fn music_liked_tracks(rp: RustyPipe) {
|
||||
let tracks = rp.query().music_liked_tracks().await.unwrap();
|
||||
assert_next_items(tracks.tracks, rp.query(), 5).await;
|
||||
}
|
||||
}
|
||||
|
||||
#[rstest]
|
||||
#[tokio::test]
|
||||
async fn user_auth_check_login(rp: RustyPipe, auth_enabled: bool) {
|
||||
|
|
@ -2743,138 +2831,6 @@ async fn user_auth_check_login(rp: RustyPipe, auth_enabled: bool) {
|
|||
}
|
||||
}
|
||||
|
||||
#[rstest]
|
||||
#[tokio::test]
|
||||
async fn history(rp: RustyPipe, cookie_auth_enabled: bool) {
|
||||
if !cookie_auth_enabled {
|
||||
return;
|
||||
}
|
||||
|
||||
let videos = rp.query().history().await.unwrap();
|
||||
assert_next_history(videos, rp.query(), 100).await;
|
||||
}
|
||||
|
||||
#[rstest]
|
||||
#[tokio::test]
|
||||
async fn history_search(rp: RustyPipe, cookie_auth_enabled: bool) {
|
||||
if !cookie_auth_enabled {
|
||||
return;
|
||||
}
|
||||
|
||||
let videos = rp.query().history_search("a").await.unwrap();
|
||||
assert_next_history(videos, rp.query(), 5).await;
|
||||
}
|
||||
|
||||
#[rstest]
|
||||
#[tokio::test]
|
||||
async fn subscriptions(rp: RustyPipe, cookie_auth_enabled: bool) {
|
||||
if !cookie_auth_enabled {
|
||||
return;
|
||||
}
|
||||
|
||||
let channels = rp.query().subscriptions().await.unwrap();
|
||||
assert_next_items(channels, rp.query(), 5).await;
|
||||
}
|
||||
|
||||
#[rstest]
|
||||
#[tokio::test]
|
||||
async fn subscription_feed(rp: RustyPipe, cookie_auth_enabled: bool) {
|
||||
if !cookie_auth_enabled {
|
||||
return;
|
||||
}
|
||||
|
||||
let videos = rp.query().subscription_feed().await.unwrap();
|
||||
assert_next_items(videos, rp.query(), 50).await;
|
||||
}
|
||||
|
||||
#[rstest]
|
||||
#[tokio::test]
|
||||
async fn liked_videos(rp: RustyPipe, cookie_auth_enabled: bool) {
|
||||
if !cookie_auth_enabled {
|
||||
return;
|
||||
}
|
||||
|
||||
let videos = rp.query().liked_videos().await.unwrap();
|
||||
assert_next_items(videos.videos, rp.query(), 5).await;
|
||||
}
|
||||
|
||||
#[rstest]
|
||||
#[tokio::test]
|
||||
async fn watch_later(rp: RustyPipe, cookie_auth_enabled: bool) {
|
||||
if !cookie_auth_enabled {
|
||||
return;
|
||||
}
|
||||
|
||||
let videos = rp.query().watch_later().await.unwrap();
|
||||
assert_next_items(videos.videos, rp.query(), 5).await;
|
||||
}
|
||||
|
||||
#[rstest]
|
||||
#[tokio::test]
|
||||
async fn music_history(rp: RustyPipe, cookie_auth_enabled: bool) {
|
||||
if !cookie_auth_enabled {
|
||||
return;
|
||||
}
|
||||
|
||||
let tracks = rp.query().music_history().await.unwrap();
|
||||
assert_next_music_history(tracks, rp.query(), 150).await;
|
||||
}
|
||||
|
||||
#[rstest]
|
||||
#[tokio::test]
|
||||
async fn music_saved_artists(rp: RustyPipe, cookie_auth_enabled: bool) {
|
||||
if !cookie_auth_enabled {
|
||||
return;
|
||||
}
|
||||
|
||||
let artists = rp.query().music_saved_artists().await.unwrap();
|
||||
assert_next_items(artists, rp.query(), 5).await;
|
||||
}
|
||||
|
||||
#[rstest]
|
||||
#[tokio::test]
|
||||
async fn music_saved_albums(rp: RustyPipe, cookie_auth_enabled: bool) {
|
||||
if !cookie_auth_enabled {
|
||||
return;
|
||||
}
|
||||
|
||||
let albums = rp.query().music_saved_albums().await.unwrap();
|
||||
assert_next_items(albums, rp.query(), 5).await;
|
||||
}
|
||||
|
||||
#[rstest]
|
||||
#[tokio::test]
|
||||
async fn music_saved_tracks(rp: RustyPipe, cookie_auth_enabled: bool) {
|
||||
if !cookie_auth_enabled {
|
||||
return;
|
||||
}
|
||||
|
||||
let tracks = rp.query().music_saved_tracks().await.unwrap();
|
||||
assert_next_items(tracks, rp.query(), 50).await;
|
||||
}
|
||||
|
||||
#[rstest]
|
||||
#[tokio::test]
|
||||
async fn music_saved_playlists(rp: RustyPipe, cookie_auth_enabled: bool) {
|
||||
if !cookie_auth_enabled {
|
||||
return;
|
||||
}
|
||||
|
||||
let playlists = rp.query().music_saved_playlists().await.unwrap();
|
||||
assert_next_items(playlists, rp.query(), 5).await;
|
||||
}
|
||||
|
||||
#[rstest]
|
||||
#[tokio::test]
|
||||
async fn music_liked_tracks(rp: RustyPipe, cookie_auth_enabled: bool) {
|
||||
if !cookie_auth_enabled {
|
||||
return;
|
||||
}
|
||||
|
||||
let tracks = rp.query().music_liked_tracks().await.unwrap();
|
||||
assert_next_items(tracks.tracks, rp.query(), 5).await;
|
||||
}
|
||||
|
||||
//#TESTUTIL
|
||||
|
||||
/// Get the language setting from the environment variable
|
||||
|
|
@ -2914,15 +2870,6 @@ fn auth_enabled(rp: RustyPipe) -> bool {
|
|||
|| rp.query().auth_enabled(ClientType::Tv)
|
||||
}
|
||||
|
||||
/// Get a flag signaling if an authenticated user is expected
|
||||
#[fixture]
|
||||
fn cookie_auth_enabled(rp: RustyPipe) -> bool {
|
||||
std::env::var("YT_AUTHENTICATED")
|
||||
.map(|v| !v.is_empty() && !v.eq_ignore_ascii_case("false"))
|
||||
.unwrap_or_default()
|
||||
|| rp.query().auth_enabled(ClientType::Desktop)
|
||||
}
|
||||
|
||||
/*
|
||||
/// Get a new RustyPipe instance with pre-set visitor data
|
||||
fn rp_visitor_data(vdata: &str) -> RustyPipe {
|
||||
|
|
|
|||
Reference in a new issue