diff options
| author | Craig Jennings <c@cjennings.net> | 2026-02-22 23:20:56 -0600 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-02-22 23:20:56 -0600 |
| commit | 3a2445080c880544985f50fb0d916534698cc073 (patch) | |
| tree | 909f98edbbb940aafb95de02457d4d6f7db3cba4 /docs/scripts/tests/conftest.py | |
| parent | 3595aa8a8122da543676717fb5825044eee99a9d (diff) | |
| download | archangel-3a2445080c880544985f50fb0d916534698cc073.tar.gz archangel-3a2445080c880544985f50fb0d916534698cc073.zip | |
chore: add docs/ to .gitignore and untrack personal files
docs/ contains session history, personal workflows, and private
protocols that shouldn't be in a public repository.
Diffstat (limited to 'docs/scripts/tests/conftest.py')
| -rw-r--r-- | docs/scripts/tests/conftest.py | 77 |
1 files changed, 0 insertions, 77 deletions
diff --git a/docs/scripts/tests/conftest.py b/docs/scripts/tests/conftest.py deleted file mode 100644 index 8d965ab..0000000 --- a/docs/scripts/tests/conftest.py +++ /dev/null @@ -1,77 +0,0 @@ -"""Shared fixtures for EML extraction tests.""" - -import os -from email.message import EmailMessage -from email.mime.application import MIMEApplication -from email.mime.multipart import MIMEMultipart -from email.mime.text import MIMEText - -import pytest - - -@pytest.fixture -def fixtures_dir(): - """Return path to the fixtures/ directory.""" - return os.path.join(os.path.dirname(__file__), 'fixtures') - - -def make_plain_message(body="Test body", from_="Jonathan Smith <jsmith@example.com>", - to="Craig <craig@example.com>", - subject="Test Subject", - date="Wed, 05 Feb 2026 11:36:00 -0600"): - """Create an EmailMessage with text/plain body.""" - msg = EmailMessage() - msg['From'] = from_ - msg['To'] = to - msg['Subject'] = subject - msg['Date'] = date - msg.set_content(body) - return msg - - -def make_html_message(html_body="<p>Test body</p>", - from_="Jonathan Smith <jsmith@example.com>", - to="Craig <craig@example.com>", - subject="Test Subject", - date="Wed, 05 Feb 2026 11:36:00 -0600"): - """Create an EmailMessage with text/html body only.""" - msg = EmailMessage() - msg['From'] = from_ - msg['To'] = to - msg['Subject'] = subject - msg['Date'] = date - msg.set_content(html_body, subtype='html') - return msg - - -def make_message_with_attachment(body="Test body", - from_="Jonathan Smith <jsmith@example.com>", - to="Craig <craig@example.com>", - subject="Test Subject", - date="Wed, 05 Feb 2026 11:36:00 -0600", - attachment_filename="document.pdf", - attachment_content=b"fake pdf content"): - """Create a multipart message with a text body and one attachment.""" - msg = MIMEMultipart() - msg['From'] = from_ - msg['To'] = to - msg['Subject'] = subject - msg['Date'] = date - - msg.attach(MIMEText(body, 'plain')) - - att = MIMEApplication(attachment_content, Name=attachment_filename) - att['Content-Disposition'] = f'attachment; filename="{attachment_filename}"' - msg.attach(att) - - return msg - - -def add_received_headers(msg, headers): - """Add Received headers to an existing message. - - headers: list of header strings, added in order (first = most recent). - """ - for header in headers: - msg['Received'] = header - return msg |
