From eccc7b0993c38f35ed56b4db94adbd3ecf46592c Mon Sep 17 00:00:00 2001 From: Brad Kenstler Date: Tue, 24 Oct 2023 12:04:06 -0700 Subject: [PATCH] Update test_gnews.py --- tests/test_gnews.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/test_gnews.py b/tests/test_gnews.py index 1114a2c..d8fca5c 100644 --- a/tests/test_gnews.py +++ b/tests/test_gnews.py @@ -33,6 +33,13 @@ def test_get_news_by_location(self): self.assertTrue(isinstance(news_articles, list)) self.assertTrue(len(news_articles) > 0) + def test_get_news_by_site(self): + # Test that get_news_by_site returns a non-empty list of news articles for a valid site + site = "cnn.com" + news_articles - self.gnews.get_news_by_site(site) + self.assertTrue(isinstance(news_articles, list)) + self.assertTrue(len(news_articles) > 0) + def test_get_full_article(self): pass # Test that get_full_article returns a valid article object for a valid URL