def test_fetcher_sets_url(mock_requests): """Test that the fetcher correctly sets the podcast's url.""" mock_requests.get(FEED_URL, text=read_test_file("canvas")) result = fetch(FEED_URL) assert result.url == FEED_URL
def test_fetcher_returns_parsed_feed(mock_requests): """Test that the fetcher correctly fetches and parses a podcast feed.""" mock_requests.get(FEED_URL, text=read_test_file("canvas")) result = fetch(FEED_URL) assert result.title == "Canvas"
def test_fetcher_sets_last_fetched(mock_requests): """Test that the fetcher correctly updates the podcast's last_fetched property.""" mock_requests.get(FEED_URL, text=read_test_file("canvas")) now = datetime.datetime.now() with freezegun.freeze_time(now): result = fetch(FEED_URL) assert result.last_fetched == now