Best Python code snippet using yandex-tank
test.pyi
Source:test.pyi  
1import sys2from wsgiref.types import WSGIEnvironment3from typing import Any, Generic, Optional, Text, Tuple, Type, TypeVar, overload4from typing_extensions import Literal5if sys.version_info < (3,):6    from urllib2 import Request as U2Request7    from cookielib import CookieJar8else:9    from urllib.request import Request as U2Request10    from http.cookiejar import CookieJar11def stream_encode_multipart(values, use_tempfile: int = ..., threshold=..., boundary: Optional[Any] = ...,12                            charset: Text = ...): ...13def encode_multipart(values, boundary: Optional[Any] = ..., charset: Text = ...): ...14def File(fd, filename: Optional[Any] = ..., mimetype: Optional[Any] = ...): ...15class _TestCookieHeaders:16    headers: Any17    def __init__(self, headers): ...18    def getheaders(self, name): ...19    def get_all(self, name, default: Optional[Any] = ...): ...20class _TestCookieResponse:21    headers: Any22    def __init__(self, headers): ...23    def info(self): ...24class _TestCookieJar(CookieJar):25    def inject_wsgi(self, environ): ...26    def extract_wsgi(self, environ, headers): ...27class EnvironBuilder:28    server_protocol: Any29    wsgi_version: Any30    request_class: Any31    charset: Text32    path: Any33    base_url: Any34    query_string: Any35    args: Any36    method: Any37    headers: Any38    content_type: Any39    errors_stream: Any40    multithread: Any41    multiprocess: Any42    run_once: Any43    environ_base: Any44    environ_overrides: Any45    input_stream: Any46    content_length: Any47    closed: Any48    def __init__(self, path: str = ..., base_url: Optional[Any] = ..., query_string: Optional[Any] = ...,49                 method: str = ..., input_stream: Optional[Any] = ..., content_type: Optional[Any] = ...,50                 content_length: Optional[Any] = ..., errors_stream: Optional[Any] = ..., multithread: bool = ...,51                 multiprocess: bool = ..., run_once: bool = ..., headers: Optional[Any] = ..., data: Optional[Any] = ...,52                 environ_base: Optional[Any] = ..., environ_overrides: Optional[Any] = ..., charset: Text = ...): ...53    form: Any54    files: Any55    @property56    def server_name(self): ...57    @property58    def server_port(self): ...59    def __del__(self): ...60    def close(self): ...61    def get_environ(self): ...62    def get_request(self, cls: Optional[Any] = ...): ...63class ClientRedirectError(Exception): ...64# Response type for the client below.65# By default _R is Tuple[Iterable[Any], Union[Text, int], datastructures.Headers]66_R = TypeVar('_R')67class Client(Generic[_R]):68    application: Any69    response_wrapper: Optional[Type[_R]]70    cookie_jar: Any71    allow_subdomain_redirects: Any72    def __init__(self, application, response_wrapper: Optional[Type[_R]] = ..., use_cookies: bool = ...,73                 allow_subdomain_redirects: bool = ...): ...74    def set_cookie(self, server_name, key, value: str = ..., max_age: Optional[Any] = ..., expires: Optional[Any] = ...,75                   path: str = ..., domain: Optional[Any] = ..., secure: Optional[Any] = ..., httponly: bool = ...,76                   charset: Text = ...): ...77    def delete_cookie(self, server_name, key, path: str = ..., domain: Optional[Any] = ...): ...78    def run_wsgi_app(self, environ, buffered: bool = ...): ...79    def resolve_redirect(self, response, new_location, environ, buffered: bool = ...): ...80    @overload81    def open(self, *args, as_tuple: Literal[True], **kwargs) -> Tuple[WSGIEnvironment, _R]: ...82    @overload83    def open(self, *args, as_tuple: Literal[False] = ..., **kwargs) -> _R: ...84    @overload85    def open(self, *args, as_tuple: bool, **kwargs) -> Any: ...86    @overload87    def get(self, *args, as_tuple: Literal[True], **kw) -> Tuple[WSGIEnvironment, _R]: ...88    @overload89    def get(self, *args, as_tuple: Literal[False] = ..., **kw) -> _R: ...90    @overload91    def get(self, *args, as_tuple: bool, **kw) -> Any: ...92    @overload93    def patch(self, *args, as_tuple: Literal[True], **kw) -> Tuple[WSGIEnvironment, _R]: ...94    @overload95    def patch(self, *args, as_tuple: Literal[False] = ..., **kw) -> _R: ...96    @overload97    def patch(self, *args, as_tuple: bool, **kw) -> Any: ...98    @overload99    def post(self, *args, as_tuple: Literal[True], **kw) -> Tuple[WSGIEnvironment, _R]: ...100    @overload101    def post(self, *args, as_tuple: Literal[False] = ..., **kw) -> _R: ...102    @overload103    def post(self, *args, as_tuple: bool, **kw) -> Any: ...104    @overload105    def head(self, *args, as_tuple: Literal[True], **kw) -> Tuple[WSGIEnvironment, _R]: ...106    @overload107    def head(self, *args, as_tuple: Literal[False] = ..., **kw) -> _R: ...108    @overload109    def head(self, *args, as_tuple: bool, **kw) -> Any: ...110    @overload111    def put(self, *args, as_tuple: Literal[True], **kw) -> Tuple[WSGIEnvironment, _R]: ...112    @overload113    def put(self, *args, as_tuple: Literal[False] = ..., **kw) -> _R: ...114    @overload115    def put(self, *args, as_tuple: bool, **kw) -> Any: ...116    @overload117    def delete(self, *args, as_tuple: Literal[True], **kw) -> Tuple[WSGIEnvironment, _R]: ...118    @overload119    def delete(self, *args, as_tuple: Literal[False] = ..., **kw) -> _R: ...120    @overload121    def delete(self, *args, as_tuple: bool, **kw) -> Any: ...122    @overload123    def options(self, *args, as_tuple: Literal[True], **kw) -> Tuple[WSGIEnvironment, _R]: ...124    @overload125    def options(self, *args, as_tuple: Literal[False] = ..., **kw) -> _R: ...126    @overload127    def options(self, *args, as_tuple: bool, **kw) -> Any: ...128    @overload129    def trace(self, *args, as_tuple: Literal[True], **kw) -> Tuple[WSGIEnvironment, _R]: ...130    @overload131    def trace(self, *args, as_tuple: Literal[False] = ..., **kw) -> _R: ...132    @overload133    def trace(self, *args, as_tuple: bool, **kw) -> Any: ...134def create_environ(*args, **kwargs): ......Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!
