Ejemplo n.º 1
0
    def test_post_retries_1(self, test_endpoint):
        d = Downloader(retries=1)
        t0 = time.time()
        with pytest.raises(DownloaderError):
            d.post(test_endpoint, timeout=1)

        tf = time.time() - t0
        assert int(tf) == 1
Ejemplo n.º 2
0
def test_silenced(caplog):
    d = Downloader(silenced=True)
    assert d.get('http://httpbin.org/status/200').status_code == 200
    assert len(caplog.text) == 0

    assert d.post('http://httpbin.org/status/200').status_code == 200
    assert len(caplog.text) == 0