mailfixture 0.6.0__tar.gz → 0.6.2__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.
- {mailfixture-0.6.0 → mailfixture-0.6.2}/LICENSE +1 -1
- {mailfixture-0.6.0 → mailfixture-0.6.2}/PKG-INFO +2 -2
- {mailfixture-0.6.0 → mailfixture-0.6.2}/pyproject.toml +1 -1
- {mailfixture-0.6.0 → mailfixture-0.6.2}/src/mailfixture/__init__.py +6 -3
- {mailfixture-0.6.0 → mailfixture-0.6.2}/tests/test_client.py +11 -1
- {mailfixture-0.6.0 → mailfixture-0.6.2}/.gitignore +0 -0
- {mailfixture-0.6.0 → mailfixture-0.6.2}/README.md +0 -0
- {mailfixture-0.6.0 → mailfixture-0.6.2}/src/mailfixture/py.typed +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
2
|
Name: mailfixture
|
|
3
|
-
Version: 0.6.
|
|
3
|
+
Version: 0.6.2
|
|
4
4
|
Summary: Email, SMS, and webhook fixtures for test suites — programmatic inboxes, capture hooks, long-polling, and OTP extraction.
|
|
5
5
|
Project-URL: Homepage, https://mailfixture.com
|
|
6
6
|
Project-URL: Documentation, https://mailfixture.com/docs
|
|
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "mailfixture"
|
|
7
|
-
version = "0.6.
|
|
7
|
+
version = "0.6.2"
|
|
8
8
|
description = "Email, SMS, and webhook fixtures for test suites — programmatic inboxes, capture hooks, long-polling, and OTP extraction."
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
license = "MIT"
|
|
@@ -67,7 +67,7 @@ __all__ = [
|
|
|
67
67
|
"MailFixtureTimeout",
|
|
68
68
|
]
|
|
69
69
|
|
|
70
|
-
__version__ = "0.6.
|
|
70
|
+
__version__ = "0.6.2"
|
|
71
71
|
|
|
72
72
|
DEFAULT_BASE_URL = "https://api.mailfixture.com"
|
|
73
73
|
#: Server-side ceiling for one long-poll request; the client chains
|
|
@@ -330,7 +330,10 @@ class Message:
|
|
|
330
330
|
subject: Optional[str]
|
|
331
331
|
text_body: Optional[str]
|
|
332
332
|
html_body: Optional[str]
|
|
333
|
-
|
|
333
|
+
#: Every header in wire order as ``{"name": ..., "value": ...}`` dicts
|
|
334
|
+
#: (original casing, folded lines unfolded; names can repeat, e.g.
|
|
335
|
+
#: ``Received``) — look them up case-insensitively.
|
|
336
|
+
headers: List[Dict[str, str]]
|
|
334
337
|
extracted: Dict[str, Any]
|
|
335
338
|
attachments: List[Attachment]
|
|
336
339
|
raw_size: int
|
|
@@ -373,7 +376,7 @@ class Message:
|
|
|
373
376
|
subject=data.get("subject"),
|
|
374
377
|
text_body=data.get("text_body"),
|
|
375
378
|
html_body=data.get("html_body"),
|
|
376
|
-
headers=data.get("headers") or
|
|
379
|
+
headers=list(data.get("headers") or []),
|
|
377
380
|
extracted=data.get("extracted") or {},
|
|
378
381
|
attachments=[
|
|
379
382
|
Attachment(
|
|
@@ -45,7 +45,11 @@ MESSAGE_DETAIL = {
|
|
|
45
45
|
"inbox_id": INBOX_ID,
|
|
46
46
|
"text_body": "Your code is 482913",
|
|
47
47
|
"html_body": None,
|
|
48
|
-
"headers":
|
|
48
|
+
"headers": [
|
|
49
|
+
{"name": "Received", "value": "from mx1.acme.test"},
|
|
50
|
+
{"name": "Received", "value": "from mx2.acme.test"},
|
|
51
|
+
{"name": "Message-ID", "value": "<1@acme.test>"},
|
|
52
|
+
],
|
|
49
53
|
"extracted": {
|
|
50
54
|
"otp": {"best": "482913", "candidates": [{"value": "482913", "score": 9.5}]},
|
|
51
55
|
"links": [
|
|
@@ -387,6 +391,12 @@ class ClientTest(unittest.TestCase):
|
|
|
387
391
|
message = self.client.wait_for_message(INBOX_ID, match="subject:Acme", timeout=5)
|
|
388
392
|
self.assertEqual(message.otp, "482913")
|
|
389
393
|
self.assertEqual(message.text_body, "Your code is 482913")
|
|
394
|
+
# headers: the wire's ordered [{name, value}] list, dupes kept
|
|
395
|
+
self.assertIsInstance(message.headers, list)
|
|
396
|
+
self.assertEqual(message.headers[2], {"name": "Message-ID", "value": "<1@acme.test>"})
|
|
397
|
+
self.assertEqual(
|
|
398
|
+
len([h for h in message.headers if h["name"].lower() == "received"]), 2
|
|
399
|
+
)
|
|
390
400
|
self.assertEqual(message.attachments[0].filename, "report.pdf")
|
|
391
401
|
self.assertTrue(message.tls)
|
|
392
402
|
self.assertEqual(message.auth.spf.result, "pass")
|
|
File without changes
|
|
File without changes
|
|
File without changes
|