Name | be-patient-ttt JSON |
Version |
0.1.0
JSON |
| download |
home_page | |
Summary | A library facilitating work with asynchronous APIs |
upload_time | 2023-08-15 08:54:21 |
maintainer | |
docs_url | None |
author | |
requires_python | >=3.10 |
license | MIT License Copyright (c) 2023 Dawid Szaniawski Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
keywords |
api
async
api_testing
automation
json
testing
web
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
[![Tests](https://github.com/dawid-szaniawski/be-patient/actions/workflows/tox.yml/badge.svg)](https://github.com/dawid-szaniawski/be-patient/actions/workflows/tox.yml)
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/be-patient)](https://pypi.org/project/be-patient/)
[![PyPI](https://img.shields.io/pypi/v/be-patient)](https://pypi.org/project/be-patient/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/dawid-szaniawski/be-patient/blob/master/LICENSE)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
[![codecov](https://codecov.io/github/dawid-szaniawski/be-patient/branch/master/graph/badge.svg?token=hY7Nb5jGgi)](https://codecov.io/github/dawid-szaniawski/be-patient)
[![CodeFactor](https://www.codefactor.io/repository/github/dawid-szaniawski/be-patient/badge)](https://www.codefactor.io/repository/github/dawid-szaniawski/be-patient)
# Be Patient
_be-patient_ is a library aimed at facilitating work with asynchronous applications. It
allows for the repeated execution of specific actions until the desired effect is achieved.
## Features
- Set up and monitor requests for expected values.
- Flexible comparison using various checkers and comparers.
- Configure multiple conditions to be met by response.
- Inspect various aspects of the response (body, status code, headers).
- Detailed logs, facilitating the analysis of the test process.
- Retry mechanism with customizable retries and delay.
## Installation
To install _be-patient_, you can use pip:
```bash
pip install be-patient
```
_be-patient_ supports Python 3.10+.
## Basic Usage
Using RequestsWaiter object:
```python
from requests import get
from be_patient import RequestsWaiter
waiter = RequestsWaiter(request=get("https://example.com/api"))
waiter.add_checker(comparer="contain", expected_value="string")
waiter.run()
response = waiter.get_result()
assert response.status_code == 200
```
Simple way:
```python
from requests import get
from be_patient import wait_for_value_in_request
response = wait_for_value_in_request(
request=get("https://example.com/api"),
comparer="contain",
expected_value="string"
)
assert response.status_code == 200
```
If we need add more than one checker:
```python
from requests import get
from be_patient import wait_for_values_in_request
list_of_checkers = [
{
"checker": "json_checker",
"comparer": "contain",
"expected_value": "string"
},
{
"checker": "headers_checker",
"comparer": "is_equal",
"expected_value": "cloudflare",
"dict_path": "Server",
},
]
response = wait_for_values_in_request(
request=get("https://example.com/api"),
checkers=list_of_checkers,
retries=5,
)
assert response.status_code == 200
```
Raw data
{
"_id": null,
"home_page": "",
"name": "be-patient-ttt",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.10",
"maintainer_email": "",
"keywords": "api,async,api_testing,automation,json,testing,web",
"author": "",
"author_email": "Dawid Szaniawski <webluduspl@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/56/d5/7fa30495af42cb4c6d3a331d98c356d918f8609368b422eede2954ebedce/be_patient-ttt-0.1.0.tar.gz",
"platform": null,
"description": "[![Tests](https://github.com/dawid-szaniawski/be-patient/actions/workflows/tox.yml/badge.svg)](https://github.com/dawid-szaniawski/be-patient/actions/workflows/tox.yml)\n[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/be-patient)](https://pypi.org/project/be-patient/)\n[![PyPI](https://img.shields.io/pypi/v/be-patient)](https://pypi.org/project/be-patient/)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/dawid-szaniawski/be-patient/blob/master/LICENSE)\n[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)\n[![codecov](https://codecov.io/github/dawid-szaniawski/be-patient/branch/master/graph/badge.svg?token=hY7Nb5jGgi)](https://codecov.io/github/dawid-szaniawski/be-patient)\n[![CodeFactor](https://www.codefactor.io/repository/github/dawid-szaniawski/be-patient/badge)](https://www.codefactor.io/repository/github/dawid-szaniawski/be-patient)\n\n# Be Patient\n\n_be-patient_ is a library aimed at facilitating work with asynchronous applications. It \nallows for the repeated execution of specific actions until the desired effect is achieved.\n\n## Features\n\n- Set up and monitor requests for expected values.\n- Flexible comparison using various checkers and comparers.\n- Configure multiple conditions to be met by response.\n- Inspect various aspects of the response (body, status code, headers).\n- Detailed logs, facilitating the analysis of the test process.\n- Retry mechanism with customizable retries and delay.\n\n## Installation\n\nTo install _be-patient_, you can use pip:\n\n```bash\npip install be-patient\n```\n\n_be-patient_ supports Python 3.10+.\n\n## Basic Usage\n\nUsing RequestsWaiter object:\n\n```python\nfrom requests import get\n\nfrom be_patient import RequestsWaiter\n\n\nwaiter = RequestsWaiter(request=get(\"https://example.com/api\"))\nwaiter.add_checker(comparer=\"contain\", expected_value=\"string\")\nwaiter.run()\n\nresponse = waiter.get_result()\n\nassert response.status_code == 200\n```\n\nSimple way:\n\n```python\nfrom requests import get\n\nfrom be_patient import wait_for_value_in_request\n\n\nresponse = wait_for_value_in_request(\n request=get(\"https://example.com/api\"),\n comparer=\"contain\",\n expected_value=\"string\"\n)\nassert response.status_code == 200\n```\n\nIf we need add more than one checker:\n\n```python\nfrom requests import get\n\nfrom be_patient import wait_for_values_in_request\n\n\nlist_of_checkers = [\n {\n \"checker\": \"json_checker\",\n \"comparer\": \"contain\",\n \"expected_value\": \"string\"\n },\n {\n \"checker\": \"headers_checker\",\n \"comparer\": \"is_equal\",\n \"expected_value\": \"cloudflare\",\n \"dict_path\": \"Server\",\n },\n]\nresponse = wait_for_values_in_request(\n request=get(\"https://example.com/api\"),\n checkers=list_of_checkers,\n retries=5,\n)\nassert response.status_code == 200\n```\n",
"bugtrack_url": null,
"license": "MIT License Copyright (c) 2023 Dawid Szaniawski Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ",
"summary": "A library facilitating work with asynchronous APIs",
"version": "0.1.0",
"project_urls": {
"Documentation": "https://webludus.pl",
"Source": "https://github.com/dawid-szaniawski/be-patient"
},
"split_keywords": [
"api",
"async",
"api_testing",
"automation",
"json",
"testing",
"web"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "c912b297c0a6a54bfbed33ddca8676caaf72a720e7d62f80bd1791bde39094c2",
"md5": "70a146ce66c601829775aa2deaad0e29",
"sha256": "d5ae8ff01c6720180ea70c0e028b52e1397cfbc8f1eb3f7ff3943d81a0d6b35f"
},
"downloads": -1,
"filename": "be_patient_ttt-0.1.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "70a146ce66c601829775aa2deaad0e29",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.10",
"size": 14590,
"upload_time": "2023-08-15T08:54:19",
"upload_time_iso_8601": "2023-08-15T08:54:19.688681Z",
"url": "https://files.pythonhosted.org/packages/c9/12/b297c0a6a54bfbed33ddca8676caaf72a720e7d62f80bd1791bde39094c2/be_patient_ttt-0.1.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "56d57fa30495af42cb4c6d3a331d98c356d918f8609368b422eede2954ebedce",
"md5": "80933be885d9344af1d613362491039c",
"sha256": "7411ca6e82095ff5c25145fd25742b847594c184c7dc70979aaf93b958cd4ebc"
},
"downloads": -1,
"filename": "be_patient-ttt-0.1.0.tar.gz",
"has_sig": false,
"md5_digest": "80933be885d9344af1d613362491039c",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.10",
"size": 14285,
"upload_time": "2023-08-15T08:54:21",
"upload_time_iso_8601": "2023-08-15T08:54:21.390079Z",
"url": "https://files.pythonhosted.org/packages/56/d5/7fa30495af42cb4c6d3a331d98c356d918f8609368b422eede2954ebedce/be_patient-ttt-0.1.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-08-15 08:54:21",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "dawid-szaniawski",
"github_project": "be-patient",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "be-patient-ttt"
}