fix test to only test download
This commit is contained in:
parent
97da1a651a
commit
51bec34b31
1 changed files with 60 additions and 49 deletions
|
|
@ -1,6 +1,7 @@
|
||||||
import re
|
import re
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
import yaml
|
||||||
|
|
||||||
from ytdl_sub.script.utils.exceptions import UserThrownRuntimeError
|
from ytdl_sub.script.utils.exceptions import UserThrownRuntimeError
|
||||||
from ytdl_sub.subscriptions.subscription import Subscription
|
from ytdl_sub.subscriptions.subscription import Subscription
|
||||||
|
|
@ -25,57 +26,67 @@ class TestTvShowByDatePreset:
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
def test_backward_compatibility_single(self, default_config):
|
def test_backward_compatibility_single_download(self, default_config):
|
||||||
a = Subscription.from_dict(
|
a = yaml.safe_load(
|
||||||
config=default_config,
|
Subscription.from_dict(
|
||||||
preset_name="a",
|
config=default_config,
|
||||||
preset_dict={
|
preset_name="a",
|
||||||
"preset": "Jellyfin TV Show by Date",
|
preset_dict={
|
||||||
"overrides": {"tv_show_directory": "abc", "url": "test_1"},
|
"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"],
|
|
||||||
},
|
},
|
||||||
},
|
).resolved_yaml()
|
||||||
)
|
)
|
||||||
|
|
||||||
c = Subscription.from_dict(
|
b = yaml.safe_load(
|
||||||
config=default_config,
|
Subscription.from_dict(
|
||||||
preset_name="a",
|
config=default_config,
|
||||||
preset_dict={
|
preset_name="a",
|
||||||
"preset": "Jellyfin TV Show by Date",
|
preset_dict={
|
||||||
"overrides": {"tv_show_directory": "abc", "urls": ["test_1", "test_2"]},
|
"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["download"] == b["download"]
|
||||||
assert a.resolved_yaml() == c.resolved_yaml()
|
|
||||||
|
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"]
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue