Asyncio userver client, typically retrieved from plugins.service_client.service_client fixture.
Compatible with werkzeug interface.
Inheritance diagram for pytest_userver.client.Client:Public Member Functions | |
| run_periodic_task (self, name) | |
| None | suspend_periodic_tasks (self, list[str] names) |
| None | resume_periodic_tasks (self, list[str] names) |
| None | resume_all_periodic_tasks (self) |
| None | write_cache_dumps (self, list[str] names, *, testsuite_skip_prepare=False) |
| None | read_cache_dumps (self, list[str] names, *, testsuite_skip_prepare=False) |
| None | run_task (self, str name) |
| None | run_distlock_task (self, str name) |
| None | reset_metrics (self) |
Calls ResetMetric(metric); for each metric that has such C++ function. | |
| dict[str, list[dict[str, str]]] | metrics_portability (self, *, str|None prefix=None) |
| Reports metrics related issues that could be encountered on different monitoring systems. | |
| list[str] | list_tasks (self) |
| spawn_task (self, str name) | |
| capture_logs (self, *, str log_level='DEBUG', bool testsuite_skip_prepare=False) | |
| Captures logs from the service. | |
| log_flush (self, str|None logger_name=None) | |
| Flush service logs. | |
| None | invalidate_caches (self, *, bool clean_update=True, list[str]|None cache_names=None, bool testsuite_skip_prepare=False) |
| Send request to service to update caches. | |
| dict[str, Any] | tests_control (self, bool invalidate_caches=True, bool clean_update=True, list[str]|None cache_names=None, list[str]|None http_allowed_urls_extra=None) |
| None | update_server_state (self) |
| Update service-side state through http call to 'tests/control': | |
| None | enable_testpoints (self, bool no_auto_cache_cleanup=False) |
| Send list of handled testpoint pats to service. | |
| dict[str, Any] | get_dynamic_config_defaults (self) |
| http.ClientResponse | post (self, str path, JsonAnyOptional json=None, Any data=None, dict[str, str]|None params=None, str|None bearer=None, str|None x_real_ip=None, dict[str, str]|None headers=None, **kwargs) |
| Make a HTTP POST request. | |
| http.ClientResponse | put (self, path, JsonAnyOptional json=None, Any data=None, dict[str, str]|None params=None, str|None bearer=None, str|None x_real_ip=None, dict[str, str]|None headers=None, **kwargs) |
| Make a HTTP PUT request. | |
| http.ClientResponse | patch (self, path, JsonAnyOptional json=None, Any data=None, dict[str, str]|None params=None, str|None bearer=None, str|None x_real_ip=None, dict[str, str]|None headers=None, **kwargs) |
| Make a HTTP PATCH request. | |
| http.ClientResponse | get (self, str path, dict[str, str]|None headers=None, str|None bearer=None, str|None x_real_ip=None, **kwargs) |
| Make a HTTP GET request. | |
| http.ClientResponse | delete (self, str path, dict[str, str]|None headers=None, str|None bearer=None, str|None x_real_ip=None, **kwargs) |
| Make a HTTP DELETE request. | |
| http.ClientResponse | options (self, str path, dict[str, str]|None headers=None, str|None bearer=None, str|None 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. | |
| raw_aiohttp_client (self) | |
Protected Member Functions | |
| Awaitable[http.ClientResponse] | _wrap_client_response (self, aiohttp.ClientResponse response) |
Protected Attributes | |
| _client = client | |
|
protected |
Reimplemented from pytest_userver.client.ClientWrapper.
| pytest_userver.client.Client.capture_logs | ( | self, | |
| * | , | ||
| str | log_level = 'DEBUG', | ||
| bool | testsuite_skip_prepare = False ) |
Captures logs from the service.
| log_level | Do not capture logs below this level. |
| testsuite_skip_prepare | An advanced parameter to skip auto-update_server_state. |
|
inherited |
| None pytest_userver.client.Client.enable_testpoints | ( | self, | |
| bool | no_auto_cache_cleanup = False ) |
Send list of handled testpoint pats to service.
For these paths service will no more skip http calls from TESTPOINT(...) macro.
| no_auto_cache_cleanup | prevent automatic cache cleanup. When calling service client first time in scope of current test, client makes additional http call to tests/control to update caches, to get rid of data from previous test. |
|
inherited |
| dict[str, Any] pytest_userver.client.Client.get_dynamic_config_defaults | ( | self | ) |
| None pytest_userver.client.Client.invalidate_caches | ( | self, | |
| * | , | ||
| bool | clean_update = True, | ||
| list[str] | None | cache_names = None, | ||
| bool | testsuite_skip_prepare = False ) |
Send request to service to update caches.
| clean_update | if False, service will do a faster incremental update of caches whenever possible. |
| cache_names | which caches specifically should be updated; update all if None. |
| testsuite_skip_prepare | if False, service will automatically do update_server_state(). |
| list[str] pytest_userver.client.Client.list_tasks | ( | self | ) |
| pytest_userver.client.Client.log_flush | ( | self, | |
| str | None | logger_name = None ) |
| dict[str, list[dict[str, str]]] pytest_userver.client.Client.metrics_portability | ( | self, | |
| * | , | ||
| str | None | prefix = None ) |
Reports metrics related issues that could be encountered on different monitoring systems.
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
| None pytest_userver.client.Client.read_cache_dumps | ( | self, | |
| list[str] | names, | ||
| * | , | ||
| testsuite_skip_prepare = False ) |
|
inherited |
| None pytest_userver.client.Client.reset_metrics | ( | self | ) |
| None pytest_userver.client.Client.resume_all_periodic_tasks | ( | self | ) |
| None pytest_userver.client.Client.resume_periodic_tasks | ( | self, | |
| list[str] | names ) |
| None pytest_userver.client.Client.run_distlock_task | ( | self, | |
| str | name ) |
| pytest_userver.client.Client.run_periodic_task | ( | self, | |
| name ) |
| None pytest_userver.client.Client.run_task | ( | self, | |
| str | name ) |
| pytest_userver.client.Client.spawn_task | ( | self, | |
| str | name ) |
| None pytest_userver.client.Client.suspend_periodic_tasks | ( | self, | |
| list[str] | names ) |
| dict[str, Any] pytest_userver.client.Client.tests_control | ( | self, | |
| bool | invalidate_caches = True, | ||
| bool | clean_update = True, | ||
| list[str] | None | cache_names = None, | ||
| list[str] | None | http_allowed_urls_extra = None ) |
| None pytest_userver.client.Client.update_server_state | ( | self | ) |
| None pytest_userver.client.Client.write_cache_dumps | ( | self, | |
| list[str] | names, | ||
| * | , | ||
| testsuite_skip_prepare = False ) |
|
protectedinherited |
|
static |
|
static |
|
static |
|
static |
|
static |