Some checks failed
CI/CD Pipeline / test (push) Failing after 4m9s
- Added email_service.py for sending emails with SMTP configuration. - Introduced email_templates.py to render job alert email subjects and bodies. - Enhanced scraper.py to extract contact information from job listings. - Updated settings.js to handle negative keyword input validation. - Created email.html and email_templates.html for managing email subscriptions and templates in the admin interface. - Modified base.html to include links for email alerts and templates. - Expanded user settings.html to allow management of negative keywords. - Updated utils.py to include functions for retrieving negative keywords and email settings. - Enhanced job filtering logic to exclude jobs containing negative keywords.
39 lines
1.1 KiB
Python
39 lines
1.1 KiB
Python
import importlib
|
|
import os
|
|
|
|
import web.utils as utils
|
|
|
|
|
|
def test_config_loaded():
|
|
cfg = utils.get_config()
|
|
assert isinstance(cfg, dict)
|
|
|
|
|
|
def test_http_settings_helpers():
|
|
assert isinstance(utils.get_user_agent(), str)
|
|
assert isinstance(utils.get_request_timeout(), int)
|
|
assert isinstance(utils.get_max_retries(), int)
|
|
assert isinstance(utils.get_backoff_factor(), int)
|
|
assert isinstance(utils.get_min_delay(), int)
|
|
assert isinstance(utils.get_max_delay(), int)
|
|
|
|
|
|
def test_negative_keywords_helper():
|
|
keywords = utils.get_negative_keywords()
|
|
assert isinstance(keywords, list)
|
|
for kw in keywords:
|
|
assert isinstance(kw, str)
|
|
assert kw == kw.lower()
|
|
|
|
|
|
def test_email_settings_helper():
|
|
settings = utils.get_email_settings()
|
|
assert isinstance(settings, dict)
|
|
assert 'enabled' in settings
|
|
assert 'from_address' in settings
|
|
smtp = settings.get('smtp')
|
|
assert isinstance(smtp, dict)
|
|
assert 'host' in smtp
|
|
assert isinstance(smtp.get('port'), int)
|
|
assert isinstance(settings.get('recipients'), list)
|