fix some tests
This commit is contained in:
parent
5224b321c8
commit
c0e79811fa
2 changed files with 25 additions and 22 deletions
|
|
@ -52,13 +52,15 @@ class UrlDownloaderBasePluginExtension(SourcePluginExtension[MultiUrlValidator])
|
||||||
|
|
||||||
if 0 <= input_url_idx < len(self.plugin_options.urls.list):
|
if 0 <= input_url_idx < len(self.plugin_options.urls.list):
|
||||||
validator = self.plugin_options.urls.list[input_url_idx]
|
validator = self.plugin_options.urls.list[input_url_idx]
|
||||||
if self.overrides.apply_formatter(validator.url) == entry_input_url:
|
for url_validator in validator.url:
|
||||||
return validator
|
if self.overrides.apply_formatter(url_validator) == entry_input_url:
|
||||||
|
return validator
|
||||||
|
|
||||||
# Match the first validator based on the URL, if one exists
|
# Match the first validator based on the URL, if one exists
|
||||||
for validator in self.plugin_options.urls.list:
|
for validator in self.plugin_options.urls.list:
|
||||||
if self.overrides.apply_formatter(validator.url) == entry_input_url:
|
for url_validator in validator.url:
|
||||||
return validator
|
if self.overrides.apply_formatter(url_validator) == entry_input_url:
|
||||||
|
return validator
|
||||||
|
|
||||||
# Return the first validator if none exist
|
# Return the first validator if none exist
|
||||||
return self.plugin_options.urls.list[0]
|
return self.plugin_options.urls.list[0]
|
||||||
|
|
|
||||||
|
|
@ -56,22 +56,23 @@ class TestTvShowCollectionPreset:
|
||||||
season_num = 0
|
season_num = 0
|
||||||
|
|
||||||
for i in range(num_urls_per_season):
|
for i in range(num_urls_per_season):
|
||||||
url = sub.overrides.apply_formatter(
|
for url_validator in url_list[itr].url:
|
||||||
url_list[itr].url,
|
url = sub.overrides.apply_formatter(
|
||||||
function_overrides={
|
url_validator,
|
||||||
# mock so bilateral url gets enabled
|
function_overrides={
|
||||||
"subscription_has_download_archive": "True"
|
# mock so bilateral url gets enabled
|
||||||
},
|
"subscription_has_download_archive": "True"
|
||||||
)
|
},
|
||||||
variables = url_list[itr].variables.dict
|
)
|
||||||
assert url == f"youtube.com/playlist?url_{season_num}_{i}"
|
variables = url_list[itr].variables.dict
|
||||||
assert (
|
assert url == f"youtube.com/playlist?url_{season_num}_{i}"
|
||||||
sub.overrides.apply_formatter(variables["collection_season_number"])
|
assert (
|
||||||
== f"{season_num}"
|
sub.overrides.apply_formatter(variables["collection_season_number"])
|
||||||
)
|
== f"{season_num}"
|
||||||
assert (
|
)
|
||||||
sub.overrides.apply_formatter(variables["collection_season_name"])
|
assert (
|
||||||
== f"The Season {season_num}"
|
sub.overrides.apply_formatter(variables["collection_season_name"])
|
||||||
)
|
== f"The Season {season_num}"
|
||||||
|
)
|
||||||
|
|
||||||
itr += 1
|
itr += len(url_list[itr].url)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue