mirror of
https://github.com/mikf/gallery-dl.git
synced 2024-11-22 02:32:33 +01:00
[tests] use extended format strings for archive ID tests
This commit is contained in:
parent
0f7d032773
commit
29e46f6875
@ -210,6 +210,7 @@ class TestExtractorResults(unittest.TestCase):
|
||||
if "#urls" in result:
|
||||
expected = result["#urls"]
|
||||
if isinstance(expected, str):
|
||||
self.assertTrue(tjob.url_list, msg="#urls")
|
||||
self.assertEqual(tjob.url_list[0], expected, msg="#urls")
|
||||
else:
|
||||
self.assertSequenceEqual(tjob.url_list, expected, msg="#urls")
|
||||
@ -288,6 +289,8 @@ class ResultJob(job.DownloadJob):
|
||||
"".join(self.extractor.directory_fmt)).format_map
|
||||
self.format_filename = TestFormatter(
|
||||
self.extractor.filename_fmt).format_map
|
||||
self.format_archive = TestFormatter(
|
||||
self.extractor.archive_fmt).format_map
|
||||
|
||||
def run(self):
|
||||
self._init()
|
||||
@ -325,7 +328,7 @@ class ResultJob(job.DownloadJob):
|
||||
json.dumps(kwdict, sort_keys=True, default=str).encode())
|
||||
|
||||
def _update_archive(self, kwdict):
|
||||
archive_id = self.extractor.archive_fmt.format_map(kwdict)
|
||||
archive_id = self.format_archive(kwdict)
|
||||
self.archive_list.append(archive_id)
|
||||
self.archive_hash.update(archive_id.encode())
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user