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
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