From: Tom Christie Date: Mon, 2 Dec 2019 12:11:15 +0000 (+0000) Subject: Minor test fixes (#583) X-Git-Tag: 0.9.0~28 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=12d00b238e837a96271d7b07b8c3b456bd82fe0c;p=thirdparty%2Fhttpx.git Minor test fixes (#583) * Minor test fixes * Fix multipart test to less ambiguous file extension -> mime type check * Include a no-file-extension case in multipart tests --- diff --git a/tests/test_config.py b/tests/test_config.py index d8d429d8..6f8d808b 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -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) diff --git a/tests/test_multipart.py b/tests/test_multipart.py index 98f8468d..3936a05d 100644 --- a/tests/test_multipart.py +++ b/tests/test_multipart.py @@ -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