Cover malformed mail DNS observations
Debian Trixie package bundle / packages (push) Failing after 13m9s
Debian Trixie package bundle / packages (push) Failing after 13m9s
This commit is contained in:
@@ -136,8 +136,9 @@ class MailSecurityMaterialTest(unittest.TestCase):
|
||||
dkim_key_directory=str(paths.dkim_dir),
|
||||
outbound_ipv4="192.0.2.5",
|
||||
mail_dns={"example.test": {
|
||||
"spf": [], "dkim": [],
|
||||
"dmarc": ["v=DMARC1; p=none; pct=25"], "errors": [],
|
||||
"spf": ["v=spf1 mx -all", "v=spf1 -all"], "dkim": [],
|
||||
"dmarc": ["v=DMARC1; p=none; pct=25"],
|
||||
"errors": ["temporary DNS failure"],
|
||||
}},
|
||||
)
|
||||
with mock.patch(
|
||||
@@ -166,6 +167,11 @@ class MailSecurityMaterialTest(unittest.TestCase):
|
||||
"v=spf1 ip4:192.0.2.5 -all")
|
||||
self.assertTrue(any(action.get("reason", "").startswith("pct")
|
||||
for action in results[0].actions))
|
||||
self.assertTrue(any(action.get("reason") ==
|
||||
"multiple SPF records are invalid"
|
||||
for action in results[0].actions))
|
||||
self.assertTrue(any(action.get("action") == "retry-dns-check"
|
||||
for action in results[0].actions))
|
||||
self.assertEqual(repeated[0].suggested, results[0].suggested)
|
||||
self.assertEqual(repeated[0].actions, results[0].actions)
|
||||
generate.assert_called_once_with("example.test", "bongo")
|
||||
|
||||
Reference in New Issue
Block a user