mirror of
https://github.com/davidhalter/django-stubs.git
synced 2026-05-24 09:18:41 +08:00
run black over stubs, add checking to travis
This commit is contained in:
@@ -16,7 +16,6 @@ from django.test import Client
|
||||
from django.test.client import FakePayload
|
||||
from django.urls import ResolverMatch
|
||||
|
||||
|
||||
class BadHeaderError(ValueError): ...
|
||||
|
||||
class HttpResponseBase:
|
||||
@@ -24,11 +23,7 @@ class HttpResponseBase:
|
||||
cookies: cookies.SimpleCookie = ...
|
||||
closed: bool = ...
|
||||
def __init__(
|
||||
self,
|
||||
content_type: Optional[str] = ...,
|
||||
status: Any = ...,
|
||||
reason: Optional[str] = ...,
|
||||
charset: Optional[str] = ...,
|
||||
self, content_type: Optional[str] = ..., status: Any = ..., reason: Optional[str] = ..., charset: Optional[str] = ...
|
||||
) -> None: ...
|
||||
@property
|
||||
def reason_phrase(self): ...
|
||||
@@ -40,17 +35,13 @@ class HttpResponseBase:
|
||||
def charset(self, value: Any) -> None: ...
|
||||
def serialize_headers(self) -> bytes: ...
|
||||
__bytes__: Any = ...
|
||||
def __setitem__(
|
||||
self, header: Union[bytes, str], value: Union[bytes, int, str]
|
||||
) -> None: ...
|
||||
def __setitem__(self, header: Union[bytes, str], value: Union[bytes, int, str]) -> None: ...
|
||||
def __delitem__(self, header: str) -> None: ...
|
||||
def __getitem__(self, header: str) -> str: ...
|
||||
def has_header(self, header: str) -> bool: ...
|
||||
__contains__: Any = ...
|
||||
def items(self): ...
|
||||
def get(
|
||||
self, header: str, alternate: Optional[Union[Tuple, str]] = ...
|
||||
) -> Optional[Union[Tuple, str]]: ...
|
||||
def get(self, header: str, alternate: Optional[Union[Tuple, str]] = ...) -> Optional[Union[Tuple, str]]: ...
|
||||
def set_cookie(
|
||||
self,
|
||||
key: str,
|
||||
@@ -64,12 +55,8 @@ class HttpResponseBase:
|
||||
samesite: Optional[str] = ...,
|
||||
) -> None: ...
|
||||
def setdefault(self, key: str, value: str) -> None: ...
|
||||
def set_signed_cookie(
|
||||
self, key: str, value: str, salt: str = ..., **kwargs: Any
|
||||
) -> None: ...
|
||||
def delete_cookie(
|
||||
self, key: str, path: str = ..., domain: Optional[str] = ...
|
||||
) -> None: ...
|
||||
def set_signed_cookie(self, key: str, value: str, salt: str = ..., **kwargs: Any) -> None: ...
|
||||
def delete_cookie(self, key: str, path: str = ..., domain: Optional[str] = ...) -> None: ...
|
||||
def make_bytes(self, value: Union[bytes, int, str]) -> bytes: ...
|
||||
def close(self) -> None: ...
|
||||
def write(self, content: str) -> Any: ...
|
||||
@@ -99,9 +86,7 @@ class HttpResponse(HttpResponseBase):
|
||||
xframe_options_exempt: bool
|
||||
streaming: bool = ...
|
||||
content: Any = ...
|
||||
def __init__(
|
||||
self, content: Any = ..., *args: Any, **kwargs: Any
|
||||
) -> None: ...
|
||||
def __init__(self, content: Any = ..., *args: Any, **kwargs: Any) -> None: ...
|
||||
def serialize(self): ...
|
||||
__bytes__: Any = ...
|
||||
@property
|
||||
@@ -128,9 +113,7 @@ class StreamingHttpResponse(HttpResponseBase):
|
||||
wsgi_request: WSGIRequest
|
||||
streaming: bool = ...
|
||||
streaming_content: Any = ...
|
||||
def __init__(
|
||||
self, streaming_content: Any = ..., *args: Any, **kwargs: Any
|
||||
) -> None: ...
|
||||
def __init__(self, streaming_content: Any = ..., *args: Any, **kwargs: Any) -> None: ...
|
||||
@property
|
||||
def content(self) -> Any: ...
|
||||
@property
|
||||
@@ -145,14 +128,7 @@ class FileResponse(StreamingHttpResponse):
|
||||
closed: bool
|
||||
context: None
|
||||
cookies: cookies.SimpleCookie
|
||||
file_to_stream: Optional[
|
||||
Union[
|
||||
io.BufferedReader,
|
||||
io.BytesIO,
|
||||
ContentFile,
|
||||
tempfile._TemporaryFileWrapper,
|
||||
]
|
||||
]
|
||||
file_to_stream: Optional[Union[io.BufferedReader, io.BytesIO, ContentFile, tempfile._TemporaryFileWrapper]]
|
||||
json: functools.partial
|
||||
request: Dict[str, str]
|
||||
resolver_match: ResolverMatch
|
||||
@@ -161,19 +137,8 @@ class FileResponse(StreamingHttpResponse):
|
||||
block_size: int = ...
|
||||
as_attachment: bool = ...
|
||||
filename: str = ...
|
||||
def __init__(
|
||||
self,
|
||||
*args: Any,
|
||||
as_attachment: bool = ...,
|
||||
filename: str = ...,
|
||||
**kwargs: Any
|
||||
) -> None: ...
|
||||
def set_headers(
|
||||
self,
|
||||
filelike: Union[
|
||||
BufferedReader, BytesIO, ContentFile, _TemporaryFileWrapper
|
||||
],
|
||||
) -> None: ...
|
||||
def __init__(self, *args: Any, as_attachment: bool = ..., filename: str = ..., **kwargs: Any) -> None: ...
|
||||
def set_headers(self, filelike: Union[BufferedReader, BytesIO, ContentFile, _TemporaryFileWrapper]) -> None: ...
|
||||
|
||||
class HttpResponseRedirectBase(HttpResponse):
|
||||
allowed_schemes: Any = ...
|
||||
@@ -188,9 +153,7 @@ class HttpResponseRedirect(HttpResponseRedirectBase):
|
||||
csrf_cookie_set: bool
|
||||
json: functools.partial
|
||||
redirect_chain: List[Tuple[str, int]]
|
||||
request: Dict[
|
||||
str, Union[Dict[str, str], FakePayload, int, str]
|
||||
]
|
||||
request: Dict[str, Union[Dict[str, str], FakePayload, int, str]]
|
||||
resolver_match: ResolverMatch
|
||||
templates: List[Template]
|
||||
wsgi_request: WSGIRequest
|
||||
@@ -253,12 +216,7 @@ class HttpResponseNotAllowed(HttpResponse):
|
||||
closed: bool
|
||||
cookies: cookies.SimpleCookie
|
||||
status_code: int = ...
|
||||
def __init__(
|
||||
self,
|
||||
permitted_methods: Union[List[str], Tuple[str, str]],
|
||||
*args: Any,
|
||||
**kwargs: Any
|
||||
) -> None: ...
|
||||
def __init__(self, permitted_methods: Union[List[str], Tuple[str, str]], *args: Any, **kwargs: Any) -> None: ...
|
||||
|
||||
class HttpResponseGone(HttpResponse):
|
||||
closed: bool
|
||||
|
||||
Reference in New Issue
Block a user