From f1b110942afe7bd61b272db7a0fb3c556b4689aa Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Wed, 13 Mar 2024 21:44:49 +0100 Subject: [PATCH] net: let localhost RetryServer tests run with an HTTP proxy active --- tests/net.TestCase | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/net.TestCase b/tests/net.TestCase index 725bbbfd..1c3d5e88 100755 --- a/tests/net.TestCase +++ b/tests/net.TestCase @@ -107,6 +107,7 @@ class NetTest(unittest.TestCase): self.assertTrue(os.path.exists(f)) self.assertEqual('tmp/com.downloader.aegis-3175421.apk', f) + @patch.dict(os.environ, clear=True) def test_download_file_retries(self): server = RetryServer() f = net.download_file('http://localhost:%d/f.txt' % server.port) @@ -114,6 +115,7 @@ class NetTest(unittest.TestCase): self.assertEqual(server.reply.split(b'\n\n')[1], Path(f).read_bytes()) server.stop() + @patch.dict(os.environ, clear=True) def test_download_file_retries_not_forever(self): """The retry logic should eventually exit with an error.""" server = RetryServer(failures=5)