diff options
| author | dirkf <fieldhouse@gmx.net> | 2023-07-20 18:49:48 +0100 | 
|---|---|---|
| committer | dirkf <fieldhouse@gmx.net> | 2023-07-25 13:19:43 +0100 | 
| commit | 7bce2ad441b874e7a1cf8cc81059c5601d832697 (patch) | |
| tree | c2632887b6251ad6a1aac76f6534972292f77533 /test/test_http.py | |
| parent | ca71e56c481c6d5ce69b4756f8f8c0aff97d79b5 (diff) | |
[build] Fix various Jython CI and test issues
Diffstat (limited to 'test/test_http.py')
| -rw-r--r-- | test/test_http.py | 13 | 
1 files changed, 9 insertions, 4 deletions
| diff --git a/test/test_http.py b/test/test_http.py index 1a6b2e878..4ec8e13e3 100644 --- a/test/test_http.py +++ b/test/test_http.py @@ -45,6 +45,7 @@ from youtube_dl.utils import (  )  from test.helper import ( +    expectedFailureIf,      FakeYDL,      FakeLogger,      http_server_port, @@ -243,6 +244,11 @@ class HTTPTestRequestHandler(compat_http_server.BaseHTTPRequestHandler):  class TestHTTP(unittest.TestCase): +    # when does it make sense to check the SSL certificate? +    _check_cert = ( +        sys.version_info >= (3, 2) +        or (sys.version_info[0] == 2 and sys.version_info[1:] >= (7, 19))) +      def setUp(self):          # HTTP server          self.http_httpd = compat_http_server.HTTPServer( @@ -307,10 +313,7 @@ class TestHTTP(unittest.TestCase):              else self.https_port if scheme == 'https'              else self.http_port, path) -    @unittest.skipUnless( -        sys.version_info >= (3, 2) -        or (sys.version_info[0] == 2 and sys.version_info[1:] >= (7, 9)), -        'No support for certificate check in SSL') +    @unittest.skipUnless(_check_cert, 'No support for certificate check in SSL')      def test_nocheckcertificate(self):          with FakeYDL({'logger': FakeLogger()}) as ydl:              with self.assertRaises(compat_urllib_error.URLError): @@ -376,6 +379,8 @@ class TestHTTP(unittest.TestCase):                  with self.assertRaises(compat_urllib_HTTPError):                      do_req(code, 'GET') +    # Jython 2.7.1 times out for some reason +    @expectedFailureIf(sys.platform.startswith('java') and sys.version_info < (2, 7, 2))      def test_content_type(self):          # https://github.com/yt-dlp/yt-dlp/commit/379a4f161d4ad3e40932dcf5aca6e6fb9715ab28          with FakeYDL({'nocheckcertificate': True}) as ydl: | 
