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):
|
||||
validator = self.plugin_options.urls.list[input_url_idx]
|
||||
if self.overrides.apply_formatter(validator.url) == entry_input_url:
|
||||
return validator
|
||||
for url_validator in validator.url:
|
||||
if self.overrides.apply_formatter(url_validator) == entry_input_url:
|
||||
return validator
|
||||
|
||||
# Match the first validator based on the URL, if one exists
|
||||
for validator in self.plugin_options.urls.list:
|
||||
if self.overrides.apply_formatter(validator.url) == entry_input_url:
|
||||
return validator
|
||||
for url_validator in validator.url:
|
||||
if self.overrides.apply_formatter(url_validator) == entry_input_url:
|
||||
return validator
|
||||
|
||||
# Return the first validator if none exist
|
||||
return self.plugin_options.urls.list[0]
|
||||
|
|
|
|||
|
|
@ -56,22 +56,23 @@ class TestTvShowCollectionPreset:
|
|||
season_num = 0
|
||||
|
||||
for i in range(num_urls_per_season):
|
||||
url = sub.overrides.apply_formatter(
|
||||
url_list[itr].url,
|
||||
function_overrides={
|
||||
# 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}"
|
||||
assert (
|
||||
sub.overrides.apply_formatter(variables["collection_season_number"])
|
||||
== f"{season_num}"
|
||||
)
|
||||
assert (
|
||||
sub.overrides.apply_formatter(variables["collection_season_name"])
|
||||
== f"The Season {season_num}"
|
||||
)
|
||||
for url_validator in url_list[itr].url:
|
||||
url = sub.overrides.apply_formatter(
|
||||
url_validator,
|
||||
function_overrides={
|
||||
# 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}"
|
||||
assert (
|
||||
sub.overrides.apply_formatter(variables["collection_season_number"])
|
||||
== f"{season_num}"
|
||||
)
|
||||
assert (
|
||||
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