コード例 #1
0
ファイル: test_sources.py プロジェクト: jamesturk/spatula
def test_source_no_timeout():
    source = URL("https://httpbin.org/delay/1")
    assert source.get_response(Scraper()).status_code == 200
コード例 #2
0
ファイル: test_sources.py プロジェクト: jamesturk/spatula
def test_source_timeout():
    source = URL("https://httpbin.org/delay/1", timeout=0.1)
    with pytest.raises(OSError):
        source.get_response(Scraper())