From efe792ec6630b7e1dddf6dfb24ed43a13c8ae0c4 Mon Sep 17 00:00:00 2001 From: Azide Date: Wed, 13 Sep 2023 14:52:49 +0800 Subject: [PATCH] =?UTF-8?q?:recycle:=20=E7=B2=BE=E7=AE=80assert?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/platforms/test_rss.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/platforms/test_rss.py b/tests/platforms/test_rss.py index c380d48..db06dd2 100644 --- a/tests/platforms/test_rss.py +++ b/tests/platforms/test_rss.py @@ -46,9 +46,9 @@ def update_time_feed_1(): root = ET.fromstring(file) item = root.find("channel/item") current_time = datetime.now(pytz.timezone("GMT")).strftime("%a, %d %b %Y %H:%M:%S %Z") - assert item is not None + assert item pubdate_elem = item.find("pubDate") - assert pubdate_elem is not None + assert pubdate_elem pubdate_elem.text = current_time return ET.tostring(root, encoding="unicode") @@ -59,7 +59,7 @@ def update_time_feed_2(): root = ET.fromstring(file) current_time = datetime.now(pytz.timezone("GMT")).strftime("%a, %d %b %Y %H:%M:%S %Z") published_element = root.find(".//{*}published") - assert published_element is not None + assert published_element published_element.text = current_time return ET.tostring(root, encoding="unicode")