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.
Files changed (21) hide show
  1. {mailbox_org_api-2.0 → mailbox_org_api-2.0.1}/PKG-INFO +1 -1
  2. {mailbox_org_api-2.0 → mailbox_org_api-2.0.1}/mailbox_org_api/APIClient.py +2 -2
  3. {mailbox_org_api-2.0 → mailbox_org_api-2.0.1}/mailbox_org_api.egg-info/PKG-INFO +1 -1
  4. {mailbox_org_api-2.0 → mailbox_org_api-2.0.1}/pyproject.toml +1 -1
  5. {mailbox_org_api-2.0 → mailbox_org_api-2.0.1}/setup.py +1 -1
  6. {mailbox_org_api-2.0 → mailbox_org_api-2.0.1}/tests/TestAPIClient.py +5 -0
  7. {mailbox_org_api-2.0 → mailbox_org_api-2.0.1}/LICENSE +0 -0
  8. {mailbox_org_api-2.0 → mailbox_org_api-2.0.1}/README.md +0 -0
  9. {mailbox_org_api-2.0 → mailbox_org_api-2.0.1}/mailbox_org_api/APIError.py +0 -0
  10. {mailbox_org_api-2.0 → mailbox_org_api-2.0.1}/mailbox_org_api/Account.py +0 -0
  11. {mailbox_org_api-2.0 → mailbox_org_api-2.0.1}/mailbox_org_api/Invoice.py +0 -0
  12. {mailbox_org_api-2.0 → mailbox_org_api-2.0.1}/mailbox_org_api/Mail.py +0 -0
  13. {mailbox_org_api-2.0 → mailbox_org_api-2.0.1}/mailbox_org_api/__init__.py +0 -0
  14. {mailbox_org_api-2.0 → mailbox_org_api-2.0.1}/mailbox_org_api.egg-info/SOURCES.txt +0 -0
  15. {mailbox_org_api-2.0 → mailbox_org_api-2.0.1}/mailbox_org_api.egg-info/dependency_links.txt +0 -0
  16. {mailbox_org_api-2.0 → mailbox_org_api-2.0.1}/mailbox_org_api.egg-info/top_level.txt +0 -0
  17. {mailbox_org_api-2.0 → mailbox_org_api-2.0.1}/setup.cfg +0 -0
  18. {mailbox_org_api-2.0 → mailbox_org_api-2.0.1}/tests/TestAccount.py +0 -0
  19. {mailbox_org_api-2.0 → mailbox_org_api-2.0.1}/tests/TestInvoice.py +0 -0
  20. {mailbox_org_api-2.0 → mailbox_org_api-2.0.1}/tests/TestMail.py +0 -0
  21. {mailbox_org_api-2.0 → mailbox_org_api-2.0.1}/tests/__init__.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mailbox-org-api
3
- Version: 2.0
3
+ Version: 2.0.1
4
4
  Summary: A library to access the mailbox.org Business API.
5
5
  Author: Hendrik Schlange
6
6
  Author-email: Hendrik Schlange <mail@heshsum.de>
@@ -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) > 1 >= params.get('page', 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:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mailbox-org-api
3
- Version: 2.0
3
+ Version: 2.0.1
4
4
  Summary: A library to access the mailbox.org Business API.
5
5
  Author: Hendrik Schlange
6
6
  Author-email: Hendrik Schlange <mail@heshsum.de>
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "mailbox-org-api"
3
- version = "2.0"
3
+ version = "2.0.1"
4
4
  authors = [
5
5
  { name="Hendrik Schlange", email="mail@heshsum.de" },
6
6
  ]
@@ -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