Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
biezhihua committed Jan 30, 2024
1 parent 0565f97 commit 01286c4
Showing 1 changed file with 9 additions and 32 deletions.
41 changes: 9 additions & 32 deletions soda_resource_tools_lib/tests/integration_1_soda_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -563,37 +563,13 @@ mod soda_tests {

#[test]
fn test_scrape_mt_error_tv1() {
use soda_resource_tools_lib::soda::{
self,
entity::{ResourceType, TransferType},
};

init_tracing();

default_lib_config();
let scrape_config = default_scrape_config();

let test_dir = tests_dir().join("test_scrape_mt_error_tv1");
clean_dir(&test_dir);

create_file(&test_dir.join("大侠霍元甲.Fearless.2020.E01.2160P.WEB-DL.H265.AAC-HDHWEB.mp4"));

soda::scrape(
ResourceType::MT,
TransferType::Copy,
scrape_config,
test_dir.to_str().unwrap().to_string(),
test_dir.to_str().unwrap().to_string(),
);

let target_file: std::path::PathBuf = test_dir
.join("大侠霍元甲.Fearless")
.join("大侠霍元甲.Fearless.2020.S01.2160p.WEB-DL.H.265.AAC-HDHWEB")
.join("大侠霍元甲.Fearless.2020.S01E01.2160p.WEB-DL.H.265.AAC-HDHWEB.mp4");

assert_eq!(true, target_file.exists());

clean_dir(&test_dir);
test_scrape_tv(
"test_scrape_mt_error_tv1",
"大侠霍元甲.Fearless.2020.E01.2160P.WEB-DL.H265.AAC-HDHWEB.mp4",
"大侠霍元甲.Fearless.2020",
"大侠霍元甲.Fearless.2020.S01.2160p.WEB-DL.H.265.AAC-HDHWEB",
"大侠霍元甲.Fearless.2020.S01E01.2160p.WEB-DL.H.265.AAC-HDHWEB.mp4",
)
}

#[test]
Expand Down Expand Up @@ -986,7 +962,6 @@ mod soda_tests {
);
}


fn test_scrape_tv(tag: &str, title: &str, root: &str, season: &str, episode: &str) {
use soda_resource_tools_lib::soda::entity::{ResourceType, TransferType};

Expand All @@ -1010,6 +985,8 @@ mod soda_tests {

let target_file: std::path::PathBuf = test_dir.join(root).join(season).join(episode);

tracing::debug!("test_scrape_tv target_file = {:?} exist = {}", target_file, target_file.exists());

assert_eq!(true, target_file.exists());

clean_dir(&test_dir);
Expand Down

0 comments on commit 01286c4

Please sign in to comment.