1
0
mirror of https://gitlab.com/fdroid/fdroidserver.git synced 2024-10-01 00:30:13 +02:00

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.
This commit is contained in:
Hans-Christoph Steiner 2020-02-05 20:28:48 +01:00
parent 25de42055e
commit 5fb368916f
No known key found for this signature in database
GPG Key ID: 3E177817BA1B9BFA

View File

@ -71,7 +71,7 @@ class IndexTest(unittest.TestCase):
fdroidserver.index.download_repo_index("http://example.org") fdroidserver.index.download_repo_index("http://example.org")
def test_download_repo_index_no_jar(self): 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") fdroidserver.index.download_repo_index("http://example.org?fingerprint=nope")
@patch('requests.head') @patch('requests.head')