From 63b783229ca72f373f75faf58194367a4bdb6a28 Mon Sep 17 00:00:00 2001 From: Colin Powell Date: Tue, 25 Jul 2023 14:59:54 -0400 Subject: [PATCH] Simplify scrapper test --- tests/podcasts_tests/test_scrapers.py | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/tests/podcasts_tests/test_scrapers.py b/tests/podcasts_tests/test_scrapers.py index 89bb8fc..5df0097 100644 --- a/tests/podcasts_tests/test_scrapers.py +++ b/tests/podcasts_tests/test_scrapers.py @@ -1,16 +1,7 @@ from vrobbler.apps.podcasts.scrapers import scrape_data_from_google_podcasts -expected_desc = ( +expected_desc_snippet = ( "NPR's Up First is the news you need to start your day. " - "The three biggest stories of the day, with reporting and analysis " - "from NPR News — in 10 minutes. Available weekdays by 6 a.m. ET, " - "with hosts Leila Fadel, Steve Inskeep, Michel Martin and A Martinez. " - "Also available on Saturdays by 8 a.m. ET, with Ayesha Rascoe and " - "Scott Simon. On Sundays, hear a longer exploration behind the " - "headlines with Rachel Martin, available by 8 a.m. ET. Subscribe " - "and listen, then support your local NPR station at donate.npr.org. " - "Support NPR's reporting by subscribing to Up First+ and unlock " - "sponsor-free listening. Learn more at plus.npr.org/upfirst" ) expected_img_url = "https://encrypted-tbn2.gstatic.com/images?q=tbn:ANd9GcR1F0CfR24RR6sme531yIkCrnK4zzmo97jeualO5drVPKG6oCk" @@ -22,7 +13,7 @@ def test_get_not_allowed_from_mopidy(): result_dict = scrape_data_from_google_podcasts(query) assert result_dict["title"] == query - assert result_dict["description"] == expected_desc + assert expected_desc_snippet in result_dict["description"] assert result_dict["image_url"] == expected_img_url assert result_dict["producer"] == "NPR" assert result_dict["google_url"] == expected_google_url