chore(tests): reorganize test suite and archive redundant scripts

- Moved legacy/redundant tests to tests/archive/.
- Relocated root-level debug scripts to tests/integration/.
- Updated tests/README.md with final organized inventory.
- Cleaned up root directory from one-off reproduction scripts.
This commit is contained in:
Scott Idem
2026-02-03 16:18:57 -05:00
parent d43474ea4b
commit 29f6cf258f
10 changed files with 48 additions and 45 deletions

View File

@@ -1,63 +0,0 @@
import sys
import os
import logging
import unittest
from unittest.mock import MagicMock, patch
# Add current directory to path
sys.path.append(os.getcwd())
# Mock app.config BEFORE imports
mock_config = MagicMock()
mock_settings = MagicMock()
mock_settings.SMTP = {}
mock_config.settings = mock_settings
sys.modules['app.config'] = mock_config
# Mock html2text before importing app.lib_email
sys.modules['html2text'] = MagicMock()
# Configure logging
logging.basicConfig(level=logging.DEBUG)
from app.lib_email import send_email
from app.config import settings
class TestEmail(unittest.TestCase):
def test_send_email_missing_settings(self):
print("\nTesting send_email with missing SMTP settings...")
# settings is already mocked to have an empty SMTP dict
result = send_email(
from_email="test@example.com",
to_email="test@example.com",
subject="Test Email",
body_html="<p>Test</p>",
test=True
)
print(f"Result (should be False): {result}")
self.assertFalse(result)
def test_send_email_invalid_port(self):
print("\nTesting send_email with invalid port...")
settings.SMTP = {
'server': 'smtp.example.com',
'port': 'invalid',
'username': 'user',
'password': 'pass'
}
result = send_email(
from_email="test@example.com",
to_email="test@example.com",
subject="Test Email",
body_html="<p>Test</p>",
test=True
)
print(f"Result (should be False): {result}")
self.assertFalse(result)
if __name__ == "__main__":
unittest.main()