Skip to content

Commit

Permalink
Fix test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
ranahaani authored Oct 28, 2023
1 parent e5a98b7 commit 7bb12e7
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions tests/test_gnews.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,19 @@ 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
def test_get_news_by_site_valid(self):
# Test that get_news_by_site returns news articles for a valid site domain
site = "cnn.com"
news_articles - self.gnews.get_news_by_site(site)
news_articles = self.gnews.get_news_by_site(site)
self.assertTrue(isinstance(news_articles, list))
self.assertTrue(len(news_articles) > 0)

def test_get_news_by_site_invalid(self):
# Test that get_news_by_site returns an empty list for an invalid site domain
site = "invalidsite123.com"
news_articles = self.gnews.get_news_by_site(site)
self.assertEqual(news_articles, [])

def test_get_full_article(self):
pass
# Test that get_full_article returns a valid article object for a valid URL
Expand Down

0 comments on commit 7bb12e7

Please sign in to comment.