test: add search mapping tests

This commit is contained in:
Theta-Dev 2022-10-10 12:09:36 +02:00
parent db6a479bcf
commit 0b9e486147
6 changed files with 36185 additions and 6 deletions

View file

@ -24,6 +24,8 @@ pub async fn download_testfiles(project_root: &Path) {
channel_info(&testfiles).await;
channel_videos_cont(&testfiles).await;
channel_playlists_cont(&testfiles).await;
search(&testfiles).await;
search_cont(&testfiles).await;
}
const CLIENT_TYPES: [ClientType; 5] = [
@ -292,3 +294,30 @@ async fn channel_playlists_cont(testfiles: &Path) {
.await
.unwrap();
}
async fn search(testfiles: &Path) {
let mut json_path = testfiles.to_path_buf();
json_path.push("search");
json_path.push("default.json");
if json_path.exists() {
return;
}
let rp = rp_testfile(&json_path);
rp.query().search("doobydoobap").await.unwrap();
}
async fn search_cont(testfiles: &Path) {
let mut json_path = testfiles.to_path_buf();
json_path.push("search");
json_path.push("cont.json");
if json_path.exists() {
return;
}
let rp = RustyPipe::new();
let search = rp.query().search("doobydoobap").await.unwrap();
let rp = rp_testfile(&json_path);
search.items.next(rp.query()).await.unwrap().unwrap();
}