From 29e46f687525ca2e1883349f4b215bbbcb8aa368 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20F=C3=A4hrmann?= Date: Thu, 10 Oct 2024 19:32:09 +0200 Subject: [PATCH] [tests] use extended format strings for archive ID tests --- test/test_results.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/test_results.py b/test/test_results.py index 168faee2..ed9c9a93 100644 --- a/test/test_results.py +++ b/test/test_results.py @@ -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())