diff --git a/tests/download.py b/tests/download.py index ac02829..e5ca1ff 100644 --- a/tests/download.py +++ b/tests/download.py @@ -11,15 +11,12 @@ async def run_feed(feed: dict) -> None: - """Download feed.""" + """Download feed and store its metadata and content.""" async with aiohttp.ClientSession() as session: async with session.get(feed["url"]) as response: text = await response.text() - metadata = { - "name": feed["name"], - "url": feed["url"], - "download_date": base_date.isoformat(), - } + metadata = feed + metadata["download_date"] = base_date.isoformat() file = Path(__file__).parent / f'data/{feed["name"]}.json' file.write_text(json.dumps(metadata, indent=4)) file = Path(__file__).parent / f"data/{feed['name']}.xml" diff --git a/tests/feedsource.py b/tests/feedsource.py index 4c861c5..79ee71b 100644 --- a/tests/feedsource.py +++ b/tests/feedsource.py @@ -56,7 +56,7 @@ def download_date(self: "FeedSource") -> datetime: @property def has_images(self: "FeedSource") -> bool: """Return has_images.""" - return self.raw.get("has_images", False) + return self.metadata.get("has_images", False) @property def date_format(self: "FeedSource") -> str: