Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
SenZmaKi committed Jun 16, 2024
1 parent 0014db7 commit 9e8be41
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -86,14 +86,14 @@ generate_release = [
test = [{ ref = "test_pahe" }, { ref = "test_gogo" }]
test_pahe = "python -m senpwai.scrapers.test --site pahe all"
test_gogo = [{ ref = "test_gogo_norm" }, { ref = "test_gogo_hls" }]
test_gogo_norm = "python -m senpwai.scrapers.test --site gogo all"
test_gogo_hls = "python -m senpwai.scrapers.test --site gogo all --hls"
test_gogo_norm = "python -m senpwai.scrapers.test --site gogo direct_links download"
test_gogo_hls = "python -m senpwai.scrapers.test --site gogo hls_links download"

test_ddl = [{ ref = "test_pahe_ddl" }, { ref = "test_gogo_ddl" }]
test_pahe_ddl = "python -m senpwai.scrapers.test --site pahe direct_links"
test_gogo_ddl = [{ ref = "test_gogo_norm_ddl" }, { ref = "test_gogo_hls_ddl" }]
test_gogo_norm_ddl = "python -m senpwai.scrapers.test --site gogo direct_links"
test_gogo_hls_ddl = "python -m senpwai.scrapers.test --site gogo hls_links --hls"
test_gogo_hls_ddl = "python -m senpwai.scrapers.test --site gogo hls_links"

build_exes = [{ ref = "build_senpwai_exe" }, { ref = "build_senpcli_exe" }]
build_senpwai_exe = "python -m scripts.setup build"
Expand Down
7 changes: 5 additions & 2 deletions senpwai/scrapers/test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import os
from shutil import rmtree as shutil_rmtree
import sys
from time import time as current_time
from typing import Any, Callable, cast
Expand Down Expand Up @@ -377,7 +378,7 @@ def test_downloading(

rt = runtime_getter()
pass_test(test_name, rt)
os.removedirs(download_folder)
shutil_rmtree(download_folder)


class ArgParser:
Expand Down Expand Up @@ -693,7 +694,8 @@ def print_metadata(metadata: AnimeMetadata):
args.end_eps,
args.path,
)
if args.arg_in_group_was_passed(COMMANDS):
COMMANDS.remove("download")
if args.arg_in_group_was_passed(["direct_links", "all"]):
direct_download_links = test_getting_direct_download_links(
args.site, download_page_links, args.quality
)
Expand Down Expand Up @@ -733,6 +735,7 @@ def print_metadata(metadata: AnimeMetadata):
args.end_eps,
args.path,
)
COMMANDS.remove("download")
if args.site == PAHE:
return print(f"Specified {PAHE} tests passed")
if was_hls:
Expand Down

0 comments on commit 9e8be41

Please sign in to comment.