Skip to content

Commit 8250612

Browse files
authored
Merge pull request #11 from drazenzen/master
Add accept_all sub status
2 parents 7186248 + 5d4b8cb commit 8250612

File tree

3 files changed

+13
-1
lines changed

3 files changed

+13
-1
lines changed

src/zerobouncesdk/zb_validate_response.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class ZBValidateResponse(ZBResponse):
1818
mail_server_did_not_respond, timeout_exceeded, failed_smtp_connection, mailbox_quota_exceeded,
1919
exception_occurred, possible_trap, role_based, global_suppression, mailbox_not_found, no_dns_entries,
2020
failed_syntax_check, possible_typo, unroutable_ip_address, leading_period_removed, does_not_accept_mail,
21-
alias_address, role_based_catch_all, disposable, toxic, alternate, mx_forward, blocked, allowed]"""
21+
alias_address, role_based_catch_all, disposable, toxic, alternate, mx_forward, blocked, allowed, accept_all]"""
2222

2323
account: str = None
2424
"""The portion of the email address before the "@" symbol."""

src/zerobouncesdk/zb_validate_sub_status.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,4 @@ class ZBValidateSubStatus(Enum):
3232
mx_forward = "mx_forward"
3333
blocked = "blocked"
3434
allowed = "allowed"
35+
accept_all = "accept_all"

tests/zero_bounce_test_case.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,17 @@ def test_validate_valid(self):
8484
self.assertEqual(response.sub_status, ZBValidateSubStatus.mailbox_not_found)
8585
self.assertEqual(response.processed_at, datetime(2023, 3, 28, 12, 30, 18, 990000))
8686

87+
def test_response_sub_status_accept_all(self):
88+
self.requests_mock.get.return_value = MockResponse({
89+
"address": "[email protected]",
90+
"status": "catch-all",
91+
"sub_status": "accept_all",
92+
})
93+
response = self.zero_bounce_client.validate("[email protected]")
94+
self.assertEqual(response.address, "[email protected]")
95+
self.assertEqual(response.status, ZBValidateStatus.catch_all)
96+
self.assertEqual(response.sub_status, ZBValidateSubStatus.accept_all)
97+
8798
def test_response_contains_errors(self):
8899
self.requests_mock.post.return_value = MockResponse({
89100
"email_batch": [],

0 commit comments

Comments
 (0)