mailbox-org-api 2.0__tar.gz → 2.0.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {mailbox_org_api-2.0 → mailbox_org_api-2.0.1}/PKG-INFO +1 -1
- {mailbox_org_api-2.0 → mailbox_org_api-2.0.1}/mailbox_org_api/APIClient.py +2 -2
- {mailbox_org_api-2.0 → mailbox_org_api-2.0.1}/mailbox_org_api.egg-info/PKG-INFO +1 -1
- {mailbox_org_api-2.0 → mailbox_org_api-2.0.1}/pyproject.toml +1 -1
- {mailbox_org_api-2.0 → mailbox_org_api-2.0.1}/setup.py +1 -1
- {mailbox_org_api-2.0 → mailbox_org_api-2.0.1}/tests/TestAPIClient.py +5 -0
- {mailbox_org_api-2.0 → mailbox_org_api-2.0.1}/LICENSE +0 -0
- {mailbox_org_api-2.0 → mailbox_org_api-2.0.1}/README.md +0 -0
- {mailbox_org_api-2.0 → mailbox_org_api-2.0.1}/mailbox_org_api/APIError.py +0 -0
- {mailbox_org_api-2.0 → mailbox_org_api-2.0.1}/mailbox_org_api/Account.py +0 -0
- {mailbox_org_api-2.0 → mailbox_org_api-2.0.1}/mailbox_org_api/Invoice.py +0 -0
- {mailbox_org_api-2.0 → mailbox_org_api-2.0.1}/mailbox_org_api/Mail.py +0 -0
- {mailbox_org_api-2.0 → mailbox_org_api-2.0.1}/mailbox_org_api/__init__.py +0 -0
- {mailbox_org_api-2.0 → mailbox_org_api-2.0.1}/mailbox_org_api.egg-info/SOURCES.txt +0 -0
- {mailbox_org_api-2.0 → mailbox_org_api-2.0.1}/mailbox_org_api.egg-info/dependency_links.txt +0 -0
- {mailbox_org_api-2.0 → mailbox_org_api-2.0.1}/mailbox_org_api.egg-info/top_level.txt +0 -0
- {mailbox_org_api-2.0 → mailbox_org_api-2.0.1}/setup.cfg +0 -0
- {mailbox_org_api-2.0 → mailbox_org_api-2.0.1}/tests/TestAccount.py +0 -0
- {mailbox_org_api-2.0 → mailbox_org_api-2.0.1}/tests/TestInvoice.py +0 -0
- {mailbox_org_api-2.0 → mailbox_org_api-2.0.1}/tests/TestMail.py +0 -0
- {mailbox_org_api-2.0 → mailbox_org_api-2.0.1}/tests/__init__.py +0 -0
|
@@ -454,8 +454,8 @@ class APIClient:
|
|
|
454
454
|
|
|
455
455
|
# Check values (without triggering a KeyError)
|
|
456
456
|
# Logic: If page_size exists and is > 1, ensure page is also > 1
|
|
457
|
-
if params.get('page_size', 0)
|
|
458
|
-
raise ValueError(f'''If 'page_size' is used, 'page' must be specified''')
|
|
457
|
+
if params.get('page_size', 0) >= 1 > params.get('page', 0):
|
|
458
|
+
raise ValueError(f'''If 'page_size' is used, a 'page' >0 must be specified''')
|
|
459
459
|
|
|
460
460
|
# 3. Use walrus operator to assign a value to a variable, but only if it exists
|
|
461
461
|
if (field := params.get('sort_field')) and field not in mail_list_sort_field:
|
|
@@ -3,7 +3,7 @@ from setuptools import find_packages, setup
|
|
|
3
3
|
setup(
|
|
4
4
|
name='mailbox_org_api',
|
|
5
5
|
packages=find_packages(),
|
|
6
|
-
version='2.0',
|
|
6
|
+
version='2.0.1',
|
|
7
7
|
description='A library to access the mailbox.org Business API',
|
|
8
8
|
author='Hendrik Schlange',
|
|
9
9
|
install_requires=['requests'],
|
|
@@ -226,6 +226,11 @@ class TestAPIClient:
|
|
|
226
226
|
['MAIL_BLACKLIST', 'MAIL_SPAMPROTECTION', 'MAIL_PASSWORDRESET_SMS', 'MAIL_BACKUPRECOVER'])
|
|
227
227
|
assert mails[0]['plan'] in ['premium', 'standard', 'light']
|
|
228
228
|
assert mails[0]['creation_date'] is not None
|
|
229
|
+
paginated_mails = api.mail_list(domain, page_size=50, page=1)
|
|
230
|
+
assert paginated_mails is not None
|
|
231
|
+
assert paginated_mails['totalHits'] is not None
|
|
232
|
+
assert paginated_mails['totalPages'] is not None
|
|
233
|
+
assert paginated_mails['results'] is not None
|
|
229
234
|
with pytest.raises(APIError):
|
|
230
235
|
api.mail_list(domain, page = 2)
|
|
231
236
|
with pytest.raises(APIError):
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|