fix tests
This commit is contained in:
parent
1af1a4882d
commit
2c3e7123f1
2 changed files with 6 additions and 3 deletions
|
|
@ -71,7 +71,7 @@ class TestThrottleProtectionPlugin:
|
||||||
),
|
),
|
||||||
assert_logs(
|
assert_logs(
|
||||||
logger=throttle_protection_logger,
|
logger=throttle_protection_logger,
|
||||||
expected_message="Sleeping between subscriptions for %0.2f seconds",
|
expected_message="Sleeping between subscriptions for 0.02 seconds",
|
||||||
log_level="info",
|
log_level="info",
|
||||||
expected_occurrences=1,
|
expected_occurrences=1,
|
||||||
),
|
),
|
||||||
|
|
@ -139,7 +139,7 @@ class TestThrottleProtectionPlugin:
|
||||||
),
|
),
|
||||||
assert_logs(
|
assert_logs(
|
||||||
logger=throttle_protection_logger,
|
logger=throttle_protection_logger,
|
||||||
expected_message="Reached subscription max downloads of %d",
|
expected_message="Reached subscription max downloads of 0 for throttle protection",
|
||||||
log_level="info",
|
log_level="info",
|
||||||
expected_occurrences=1,
|
expected_occurrences=1,
|
||||||
),
|
),
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,7 @@ from ytdl_sub.downloaders.ytdlp import YTDLP
|
||||||
from ytdl_sub.subscriptions.subscription import Subscription
|
from ytdl_sub.subscriptions.subscription import Subscription
|
||||||
from ytdl_sub.utils.exceptions import ValidationException
|
from ytdl_sub.utils.exceptions import ValidationException
|
||||||
from ytdl_sub.utils.ffmpeg import FFMPEG
|
from ytdl_sub.utils.ffmpeg import FFMPEG
|
||||||
|
from ytdl_sub.utils.file_path import FilePathTruncater
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
|
|
@ -31,7 +32,9 @@ class TestYtdlOptions:
|
||||||
):
|
):
|
||||||
expected_ytdl_options = {
|
expected_ytdl_options = {
|
||||||
"ignoreerrors": True,
|
"ignoreerrors": True,
|
||||||
"outtmpl": f"{working_directory}/test_ytdl_options/%(id)S.%(ext)s",
|
"outtmpl": FilePathTruncater.to_native_filepath(
|
||||||
|
f"{working_directory}/test_ytdl_options/%(id)S.%(ext)s"
|
||||||
|
),
|
||||||
"writethumbnail": False,
|
"writethumbnail": False,
|
||||||
"ffmpeg_location": FFMPEG.ffmpeg_path(),
|
"ffmpeg_location": FFMPEG.ffmpeg_path(),
|
||||||
"match_filter": yt_dlp.utils.match_filter_func(
|
"match_filter": yt_dlp.utils.match_filter_func(
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue