userver: pytest_userver.client.ClientWrapper Class Reference
Loading...
Searching...
No Matches
pytest_userver.client.ClientWrapper Class Reference

Base asyncio userver client that implements HTTP requests to service. More...

+ Inheritance diagram for pytest_userver.client.ClientWrapper:

Public Member Functions

 __init__ (self, client)
 
http.ClientResponse post (self, str path, annotations.JsonAnyOptional json=None, typing.Any data=None, typing.Optional[typing.Dict[str, str]] params=None, typing.Optional[str] bearer=None, typing.Optional[str] x_real_ip=None, typing.Optional[typing.Dict[str, str]] headers=None, **kwargs)
 Make a HTTP POST request.
 
http.ClientResponse put (self, path, annotations.JsonAnyOptional json=None, typing.Any data=None, typing.Optional[typing.Dict[str, str]] params=None, typing.Optional[str] bearer=None, typing.Optional[str] x_real_ip=None, typing.Optional[typing.Dict[str, str]] headers=None, **kwargs)
 Make a HTTP PUT request.
 
http.ClientResponse patch (self, path, annotations.JsonAnyOptional json=None, typing.Any data=None, typing.Optional[typing.Dict[str, str]] params=None, typing.Optional[str] bearer=None, typing.Optional[str] x_real_ip=None, typing.Optional[typing.Dict[str, str]] headers=None, **kwargs)
 Make a HTTP PATCH request.
 
http.ClientResponse get (self, str path, typing.Optional[typing.Dict[str, str]] headers=None, typing.Optional[str] bearer=None, typing.Optional[str] x_real_ip=None, **kwargs)
 Make a HTTP GET request.
 
http.ClientResponse delete (self, str path, typing.Optional[typing.Dict[str, str]] headers=None, typing.Optional[str] bearer=None, typing.Optional[str] x_real_ip=None, **kwargs)
 Make a HTTP DELETE request.
 
http.ClientResponse options (self, str path, typing.Optional[typing.Dict[str, str]] headers=None, typing.Optional[str] bearer=None, typing.Optional[str] x_real_ip=None, **kwargs)
 Make a HTTP OPTIONS request.
 
http.ClientResponse request (self, str http_method, str path, **kwargs)
 Make a HTTP request with the specified method.
 

Protected Member Functions

typing.Awaitable[http.ClientResponse] _wrap_client_response (self, aiohttp.ClientResponse response)
 

Protected Attributes

 _client
 

Detailed Description

Base asyncio userver client that implements HTTP requests to service.

Compatible with werkzeug interface.

Definition at line 86 of file client.py.

Constructor & Destructor Documentation

◆ __init__()

pytest_userver.client.ClientWrapper.__init__ (   self,
  client 
)

Definition at line 95 of file client.py.

Member Function Documentation

◆ _wrap_client_response()

typing.Awaitable[http.ClientResponse] pytest_userver.client.ClientWrapper._wrap_client_response (   self,
aiohttp.ClientResponse  response 
)
protected

Definition at line 245 of file client.py.

◆ delete()

http.ClientResponse pytest_userver.client.ClientWrapper.delete (   self,
str  path,
typing.Optional[typing.Dict[str, str]]   headers = None,
typing.Optional[str]   bearer = None,
typing.Optional[str]   x_real_ip = None,
**  kwargs 
)

Make a HTTP DELETE request.

Definition at line 196 of file client.py.

◆ get()

http.ClientResponse pytest_userver.client.ClientWrapper.get (   self,
str  path,
typing.Optional[typing.Dict[str, str]]   headers = None,
typing.Optional[str]   bearer = None,
typing.Optional[str]   x_real_ip = None,
**  kwargs 
)

Make a HTTP GET request.

Definition at line 176 of file client.py.

◆ options()

http.ClientResponse pytest_userver.client.ClientWrapper.options (   self,
str  path,
typing.Optional[typing.Dict[str, str]]   headers = None,
typing.Optional[str]   bearer = None,
typing.Optional[str]   x_real_ip = None,
**  kwargs 
)

Make a HTTP OPTIONS request.

Definition at line 216 of file client.py.

◆ patch()

http.ClientResponse pytest_userver.client.ClientWrapper.patch (   self,
  path,
annotations.JsonAnyOptional   json = None,
typing.Any   data = None,
typing.Optional[typing.Dict[str, str]]   params = None,
typing.Optional[str]   bearer = None,
typing.Optional[str]   x_real_ip = None,
typing.Optional[typing.Dict[str, str]]   headers = None,
**  kwargs 
)

Make a HTTP PATCH request.

Definition at line 150 of file client.py.

◆ post()

http.ClientResponse pytest_userver.client.ClientWrapper.post (   self,
str  path,
annotations.JsonAnyOptional   json = None,
typing.Any   data = None,
typing.Optional[typing.Dict[str, str]]   params = None,
typing.Optional[str]   bearer = None,
typing.Optional[str]   x_real_ip = None,
typing.Optional[typing.Dict[str, str]]   headers = None,
**  kwargs 
)

Make a HTTP POST request.

Definition at line 98 of file client.py.

◆ put()

http.ClientResponse pytest_userver.client.ClientWrapper.put (   self,
  path,
annotations.JsonAnyOptional   json = None,
typing.Any   data = None,
typing.Optional[typing.Dict[str, str]]   params = None,
typing.Optional[str]   bearer = None,
typing.Optional[str]   x_real_ip = None,
typing.Optional[typing.Dict[str, str]]   headers = None,
**  kwargs 
)

Make a HTTP PUT request.

Definition at line 124 of file client.py.

◆ request()

http.ClientResponse pytest_userver.client.ClientWrapper.request (   self,
str  http_method,
str  path,
**  kwargs 
)

Make a HTTP request with the specified method.

Definition at line 236 of file client.py.

Member Data Documentation

◆ _client

pytest_userver.client.ClientWrapper._client
protected

Definition at line 96 of file client.py.


The documentation for this class was generated from the following file: