]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
pytest: fix conditions for test_02_28
authorViktor Szakats <commit@vsz.me>
Mon, 10 Nov 2025 21:43:59 +0000 (22:43 +0100)
committerViktor Szakats <commit@vsz.me>
Mon, 10 Nov 2025 22:30:20 +0000 (23:30 +0100)
- allow 02_28 to run in HTTP/1.1 without H2 support again.
  Follow-up to 3752de465d70552106b2527fbf821aee525e53e2 #19412

- fix to skip 02_28 for all protocols for curl without compression
  support (either zlib, brotli or ztsd).

Closes #19458

tests/http/test_02_download.py
tests/http/testenv/env.py

index d2d149f20fb9384acbca2674dde652ed87561557..13d5d2a0f0a14a80f84db4950177a3d24d68f158 100644 (file)
@@ -581,7 +581,9 @@ class TestDownload:
 
     @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3'])
     def test_02_28_get_compressed(self, env: Env, httpd, nghttpx, proto):
-        if not env.have_h2_curl():
+        if not env.have_compressed_curl():
+            pytest.skip("--compressed not supported")
+        if proto == 'h2' and not env.have_h2_curl():
             pytest.skip("h2 not supported")
         if proto == 'h3' and not env.have_h3():
             pytest.skip("h3 not supported")
index 859b704a35a3bd565e7e26c25fae32c1d7690c2e..31db10499457173a594ce025a25b19a2795c9949 100644 (file)
@@ -406,6 +406,12 @@ class Env:
     def have_h3_curl() -> bool:
         return 'http3' in Env.CONFIG.curl_props['features']
 
+    @staticmethod
+    def have_compressed_curl() -> bool:
+        return 'brotli' in Env.CONFIG.curl_props['libs'] or \
+               'zlib' in Env.CONFIG.curl_props['libs'] or \
+               'zstd' in Env.CONFIG.curl_props['libs']
+
     @staticmethod
     def curl_uses_lib(libname: str) -> bool:
         return libname.lower() in Env.CONFIG.curl_props['libs']