Co-authored-by: T-256 <Tester@test.com>
This commit is contained in:
T-256 2024-03-01 23:19:23 +03:30 committed by GitHub
parent f3eb3c90fd
commit 0006ed0547
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
9 changed files with 11 additions and 5 deletions

View File

@ -2,6 +2,7 @@
The _compat module is used for code which requires branching between different
Python environments. It is excluded from the code coverage checks.
"""
import ssl
import sys

View File

@ -3,6 +3,7 @@ Handlers for Content-Encoding.
See: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Encoding
"""
from __future__ import annotations
import codecs

View File

@ -30,6 +30,7 @@ Our exception hierarchy:
x ResponseNotRead
x RequestNotRead
"""
from __future__ import annotations
import contextlib

View File

@ -23,6 +23,7 @@ client = httpx.Client(transport=transport)
transport = httpx.HTTPTransport(uds="socket.uds")
client = httpx.Client(transport=transport)
"""
from __future__ import annotations
import contextlib

View File

@ -15,6 +15,7 @@ Previously we relied on the excellent `rfc3986` package to handle URL parsing an
validation, but this module provides a simpler alternative, with less indirection
required.
"""
from __future__ import annotations
import ipaddress

View File

@ -93,12 +93,11 @@ text = "\n---\n\n[Full changelog](https://github.com/encode/httpx/blob/master/CH
pattern = 'src="(docs/img/.*?)"'
replacement = 'src="https://raw.githubusercontent.com/encode/httpx/master/\1"'
# https://beta.ruff.rs/docs/configuration/#using-rufftoml
[tool.ruff]
[tool.ruff.lint]
select = ["E", "F", "I", "B", "PIE"]
ignore = ["B904", "B028"]
[tool.ruff.isort]
[tool.ruff.lint.isort]
combine-as-imports = true
[tool.ruff.lint.per-file-ignores]

View File

@ -3,6 +3,7 @@ Integration tests for authentication.
Unit tests for auth classes also exist in tests/test_auth.py
"""
import hashlib
import netrc
import os

View File

@ -3,6 +3,7 @@ Unit tests for auth classes.
Integration tests also exist in tests/client/test_auth.py
"""
from urllib.request import parse_keqv_list
import pytest

View File

@ -462,8 +462,8 @@ class TestHeaderParamHTML5Formatting:
assert expected in request.read()
def test_unicode_with_control_character(self):
filename = "hello\x1A\x1B\x1C"
expected = b'filename="hello%1A\x1B%1C"'
filename = "hello\x1a\x1b\x1c"
expected = b'filename="hello%1A\x1b%1C"'
files = {"upload": (filename, b"<file content>")}
request = httpx.Request("GET", "https://www.example.com", files=files)
assert expected in request.read()