From 5fb368916fedb6bdb16df34b3db468ece6e728e0 Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Wed, 5 Feb 2020 20:28:48 +0100 Subject: [PATCH] index: fix no JAR test case that fails on example.org http://example.org/index-v1.jar now returns the HTTP header "Content-Encoding: gzip" but then the reply is plain HTML. That triggers a ContentDecodingError instead of an HTTPError, so this changes the test to success on any RequestsException. --- tests/index.TestCase | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/index.TestCase b/tests/index.TestCase index 43db9433..5fb56f10 100755 --- a/tests/index.TestCase +++ b/tests/index.TestCase @@ -71,7 +71,7 @@ class IndexTest(unittest.TestCase): fdroidserver.index.download_repo_index("http://example.org") def test_download_repo_index_no_jar(self): - with self.assertRaises(requests.exceptions.HTTPError): + with self.assertRaises(requests.exceptions.RequestException): fdroidserver.index.download_repo_index("http://example.org?fingerprint=nope") @patch('requests.head')