fix test to only test download

This commit is contained in:
Jesse Bannon 2026-01-23 10:25:23 -08:00
parent 97da1a651a
commit 51bec34b31

View file

@ -1,6 +1,7 @@
import re
import pytest
import yaml
from ytdl_sub.script.utils.exceptions import UserThrownRuntimeError
from ytdl_sub.subscriptions.subscription import Subscription
@ -25,57 +26,67 @@ class TestTvShowByDatePreset:
},
)
def test_backward_compatibility_single(self, default_config):
a = Subscription.from_dict(
config=default_config,
preset_name="a",
preset_dict={
"preset": "Jellyfin TV Show by Date",
"overrides": {"tv_show_directory": "abc", "url": "test_1"},
},
)
b = Subscription.from_dict(
config=default_config,
preset_name="a",
preset_dict={
"preset": "Jellyfin TV Show by Date",
"overrides": {"tv_show_directory": "abc", "subscription_value": "test_1"},
},
)
assert a.resolved_yaml() == b.resolved_yaml()
def test_backward_compatibility_multi(self, default_config):
a = Subscription.from_dict(
config=default_config,
preset_name="a",
preset_dict={
"preset": "Jellyfin TV Show by Date",
"overrides": {"tv_show_directory": "abc", "url": "test_1", "url2": "test_2"},
},
)
b = Subscription.from_dict(
config=default_config,
preset_name="a",
preset_dict={
"preset": "Jellyfin TV Show by Date",
"overrides": {
"tv_show_directory": "abc",
"subscription_array": ["test_1", "test_2"],
def test_backward_compatibility_single_download(self, default_config):
a = yaml.safe_load(
Subscription.from_dict(
config=default_config,
preset_name="a",
preset_dict={
"preset": "Jellyfin TV Show by Date",
"overrides": {"tv_show_directory": "abc", "url": "test_1"},
},
},
).resolved_yaml()
)
c = Subscription.from_dict(
config=default_config,
preset_name="a",
preset_dict={
"preset": "Jellyfin TV Show by Date",
"overrides": {"tv_show_directory": "abc", "urls": ["test_1", "test_2"]},
},
b = yaml.safe_load(
Subscription.from_dict(
config=default_config,
preset_name="a",
preset_dict={
"preset": "Jellyfin TV Show by Date",
"overrides": {"tv_show_directory": "abc", "subscription_value": "test_1"},
},
).resolved_yaml()
)
assert a.resolved_yaml() == b.resolved_yaml()
assert a.resolved_yaml() == c.resolved_yaml()
assert a["download"] == b["download"]
def test_backward_compatibility_multi_download(self, default_config):
a = yaml.safe_load(
Subscription.from_dict(
config=default_config,
preset_name="a",
preset_dict={
"preset": "Jellyfin TV Show by Date",
"overrides": {"tv_show_directory": "abc", "url": "test_1", "url2": "test_2"},
},
).resolved_yaml()
)
b = yaml.safe_load(
Subscription.from_dict(
config=default_config,
preset_name="a",
preset_dict={
"preset": "Jellyfin TV Show by Date",
"overrides": {
"tv_show_directory": "abc",
"subscription_array": ["test_1", "test_2"],
},
},
).resolved_yaml()
)
c = yaml.safe_load(
Subscription.from_dict(
config=default_config,
preset_name="a",
preset_dict={
"preset": "Jellyfin TV Show by Date",
"overrides": {"tv_show_directory": "abc", "urls": ["test_1", "test_2"]},
},
).resolved_yaml()
)
assert a["download"] == b["download"]
assert a["download"] == c["download"]