Add unit tests for authentication and webhook parsing

- Implement tests for basic and bearer authentication headers in `test_auth.py`.
- Create tests for the `EasybillWebhookParser` in `test_webhooks.py`, covering JSON and form-encoded payloads, as well as a generic parse and acknowledgement method.
This commit is contained in:
claudi 2026-04-17 10:20:12 +02:00
commit caacb339dd
550 changed files with 127217 additions and 0 deletions

48
generated/async/setup.py Normal file
View file

@ -0,0 +1,48 @@
"""
easybill REST API
The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode('<email>:<api_key>') # Bearer Token Authorization: Bearer <api_key> ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older.
The version of the OpenAPI document: 1.96.0
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
from setuptools import setup, find_packages # noqa: H301
# To install the library, run the following
#
# python setup.py install
#
# prerequisite: setuptools
# http://pypi.python.org/pypi/setuptools
NAME = "easybill-generated-async"
VERSION = "1.0.0"
PYTHON_REQUIRES = ">= 3.10"
REQUIRES = [
"python-dateutil >= 2.8.2",
"aiohttp >= 3.8.4",
"aiohttp-retry >= 2.8.3",
"pydantic >= 2.11",
"typing-extensions >= 4.7.1",
]
setup(
name=NAME,
version=VERSION,
description="easybill REST API",
author="OpenAPI Generator community",
author_email="team@openapitools.org",
url="",
keywords=["OpenAPI", "OpenAPI-Generator", "easybill REST API"],
install_requires=REQUIRES,
packages=find_packages(exclude=["test", "tests"]),
include_package_data=True,
long_description_content_type='text/markdown',
long_description="""\
The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: &#x60;Basic Auth&#x60; or &#x60;Bearer Token&#x60;. In each HTTP request, one of the following HTTP headers is required: &#x60;&#x60;&#x60; # Basic Auth Authorization: Basic base64_encode(&#39;&lt;email&gt;:&lt;api_key&gt;&#39;) # Bearer Token Authorization: Bearer &lt;api_key&gt; &#x60;&#x60;&#x60; ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: &#x60;429 Too Many Requests&#x60; ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter &#x60;limit&#x60; to a maximum of 1000. ## Query filter Many list resources can be filtered. In &#x60;/documents&#x60; you can filter e.g. by number with &#x60;/documents?number&#x3D;111028654&#x60;. If you want to filter multiple numbers, you can either enter them separated by commas &#x60;/documents?number&#x3D;111028654,222006895&#x60; or as an array &#x60;/documents?number[]&#x3D;111028654&amp;number[]&#x3D;222006895&#x60;. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: &#x60;414 Request-URI Too Large&#x60; ### Escape commas in query You can escape commans in query &#x60;name&#x3D;Patrick\\, Peter&#x60; if you submit the header &#x60;X-Easybill-Escape: true&#x60; in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone &#x60;Europe/Berlin&#x60;. * **date** &#x3D; *Y-m-d* &#x3D; &#x60;2016-12-31&#x60; * **date-time** &#x3D; *Y-m-d H:i:s* &#x3D; &#x60;2016-12-31 03:13:37&#x60; Date or datetime can be &#x60;null&#x60; because the attributes have been added later and the entry is older.
""", # noqa: E501
package_data={"easybill_generated_async": ["py.typed"]},
)