have _warcprox_write_record also raise ProxyError when appropriate, and test this

This commit is contained in:
Noah Levitt 2017-04-18 16:58:51 -07:00
parent ac972d399f
commit 5603ff5380
3 changed files with 12 additions and 1 deletions

View file

@ -146,6 +146,15 @@ def test_proxy_down():
with pytest.raises(brozzler.ProxyError):
worker._fetch_url(site, page)
# WARCPROX_WRITE_RECORD
with pytest.raises(brozzler.ProxyError):
worker._warcprox_write_record(
warcprox_address=not_listening_proxy,
url='test://proxy_down/warcprox_write_record',
warc_type='metadata',
content_type='text/plain',
payload=b'''payload doesn't matter here''')
def test_start_stop_backwards_compat():
site = brozzler.Site(None, {'seed': 'http://example.com/'})
assert len(site.starts_and_stops) == 1