You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
45 lines
1.4 KiB
Python
45 lines
1.4 KiB
Python
"""Tests for the direct-outreach list builder (pure helpers)."""
|
|
from datetime import date
|
|
|
|
from gimme_job.proactive.outreach import (
|
|
_is_practice_url,
|
|
_looks_like_practice,
|
|
build_outreach_report,
|
|
)
|
|
|
|
|
|
def test_is_practice_url_excludes_boards():
|
|
assert _is_practice_url("https://www.indeed.com/jobs/1") is False
|
|
assert _is_practice_url("https://wd5.myworkdayjobs.com/acme/job/1") is False
|
|
assert _is_practice_url("https://www.usajobs.gov/job/1") is False
|
|
assert _is_practice_url("https://www.smileclinicphoenix.com") is True
|
|
|
|
|
|
def test_looks_like_practice():
|
|
assert _looks_like_practice({"email": "dr@clinic.com", "phone": None}) is True
|
|
assert _looks_like_practice({"email": None, "phone": "6025551234"}) is True
|
|
assert _looks_like_practice({"email": None, "phone": None}) is False
|
|
|
|
|
|
def test_build_report_only_lists_contact_practices():
|
|
contacts = [
|
|
{
|
|
"url": "https://a.com",
|
|
"name": "Smile Ortho",
|
|
"email": "dr@a.com",
|
|
"phone": None,
|
|
"state": "AZ",
|
|
},
|
|
{
|
|
"url": "https://b.com",
|
|
"name": "No Contact Ortho",
|
|
"email": None,
|
|
"phone": None,
|
|
"state": "CA",
|
|
},
|
|
]
|
|
text = build_outreach_report(contacts, date(2026, 9, 12))
|
|
assert "Smile Ortho" in text
|
|
assert "dr@a.com" in text
|
|
assert "No Contact Ortho" not in text
|
|
assert "## 후보 클리닉 (1)" in text |