コード例 #1
0
ファイル: fetcher_test.py プロジェクト: Podato/podato
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
コード例 #2
0
ファイル: fetcher_test.py プロジェクト: Podato/podato
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"
コード例 #3
0
ファイル: fetcher_test.py プロジェクト: Podato/podato
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