]> git.ipfire.org Git - thirdparty/httpx.git/commitdiff
Minor test fixes (#583)
authorTom Christie <tom@tomchristie.com>
Mon, 2 Dec 2019 12:11:15 +0000 (12:11 +0000)
committerGitHub <noreply@github.com>
Mon, 2 Dec 2019 12:11:15 +0000 (12:11 +0000)
* Minor test fixes

* Fix multipart test to less ambiguous file extension -> mime type check

* Include a no-file-extension case in multipart tests

tests/test_config.py
tests/test_multipart.py

index d8d429d811de1ec29c52f60d30c22a4237cc5bf3..6f8d808b2c5658d0862f4df6194f4822b9153806 100644 (file)
@@ -222,7 +222,7 @@ def test_timeout_repr():
     reason="requires OpenSSL 1.1.1 or higher",
 )
 @pytest.mark.skipif(sys.version_info < (3, 8), reason="requires python3.8 or higher")
-def test_ssl_config_support_for_keylog_file(tmpdir, monkeypatch):
+def test_ssl_config_support_for_keylog_file(tmpdir, monkeypatch):  # pragma: nocover
     with monkeypatch.context() as m:
         m.delenv("SSLKEYLOGFILE", raising=False)
 
index 98f8468d63885467e5ef11e7d3bcc3971ed0aa48..3936a05de7bf8aee0ffae2d5c240a1c94b310da5 100644 (file)
@@ -149,7 +149,11 @@ def test_multipart_encode_files_allows_filenames_as_none():
 
 @pytest.mark.parametrize(
     "file_name,expected_content_type",
-    [("example.json", "application/json"), ("example.log", "application/octet-stream")],
+    [
+        ("example.json", "application/json"),
+        ("example.txt", "text/plain"),
+        ("no-extension", "application/octet-stream"),
+    ],
 )
 def test_multipart_encode_files_guesses_correct_content_type(
     file_name, expected_content_type