From 600ec069c31b4bdf734efde5f49f45a073411eb5 Mon Sep 17 00:00:00 2001 From: Jesse Bannon Date: Sun, 29 Sep 2024 23:58:26 -0700 Subject: [PATCH] fix test --- .../unit/plugins/test_throttle_protection.py | 30 ++++++++++--------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/tests/unit/plugins/test_throttle_protection.py b/tests/unit/plugins/test_throttle_protection.py index 110d6720..424887ad 100644 --- a/tests/unit/plugins/test_throttle_protection.py +++ b/tests/unit/plugins/test_throttle_protection.py @@ -8,7 +8,7 @@ from ytdl_sub.subscriptions.subscription import Subscription @pytest.fixture -def throtte_subscription_dict(output_directory) -> Dict: +def throttle_subscription_dict(output_directory) -> Dict: return { "preset": [ "Kodi Music Videos", @@ -16,6 +16,8 @@ def throtte_subscription_dict(output_directory) -> Dict: "overrides": { "url": "https://your.name.here", "music_video_directory": output_directory, + "bool_false_variable": "{ %bool(False) }", + "empty_string_variable": "", }, "throttle_protection": { "sleep_per_download_s": { @@ -35,14 +37,14 @@ class TestThrottleProtectionPlugin: self, config, subscription_name, - throtte_subscription_dict, + throttle_subscription_dict, output_directory, mock_download_collection_entries, ): subscription = Subscription.from_dict( config=config, preset_name=subscription_name, - preset_dict=throtte_subscription_dict, + preset_dict=throttle_subscription_dict, ) with ( @@ -76,24 +78,24 @@ class TestThrottleProtectionPlugin: [ "", False, - "{tp_bool_string}", - "{tp_empty_string}", + "{bool_false_variable}", + "{empty_string_variable}", ], ) def test_disabled( self, config, subscription_name, - throtte_subscription_dict, + throttle_subscription_dict, output_directory, mock_download_collection_entries, disable_value, ): - throtte_subscription_dict["throttle_protection"]["enable"] = disable_value + throttle_subscription_dict["throttle_protection"]["enable"] = disable_value subscription = Subscription.from_dict( config=config, preset_name=subscription_name, - preset_dict=throtte_subscription_dict, + preset_dict=throttle_subscription_dict, ) with ( @@ -113,17 +115,17 @@ class TestThrottleProtectionPlugin: self, config, subscription_name, - throtte_subscription_dict, + throttle_subscription_dict, output_directory, mock_download_collection_entries, ): - throtte_subscription_dict["throttle_protection"] = { + throttle_subscription_dict["throttle_protection"] = { "max_downloads_per_subscription": {"max": 0} } subscription = Subscription.from_dict( config=config, preset_name=subscription_name, - preset_dict=throtte_subscription_dict, + preset_dict=throttle_subscription_dict, ) with ( @@ -145,17 +147,17 @@ class TestThrottleProtectionPlugin: self, config, subscription_name, - throtte_subscription_dict, + throttle_subscription_dict, output_directory, mock_download_collection_entries, ): - throtte_subscription_dict["throttle_protection"] = { + throttle_subscription_dict["throttle_protection"] = { "subscription_download_probability": 0.0 } subscription = Subscription.from_dict( config=config, preset_name=subscription_name, - preset_dict=throtte_subscription_dict, + preset_dict=throttle_subscription_dict, ) with (