39 lines
1.6 KiB
Python
39 lines
1.6 KiB
Python
import db, tailor, scraper, audit
|
|
|
|
db.init_db()
|
|
|
|
# 1. internet check via urllib
|
|
try:
|
|
import urllib.request
|
|
urllib.request.urlopen("https://remoteok.com/api", timeout=10)
|
|
print("INTERNET: reachable")
|
|
except Exception as e:
|
|
print("INTERNET: blocked ->", type(e).__name__)
|
|
|
|
# 2. synthetic job -> full pipeline
|
|
job = {
|
|
"title": "Senior DevOps Engineer",
|
|
"company": "Acme",
|
|
"description": "Seeking a Linux systems engineer with Proxmox, Docker, Python automation, and networking experience.",
|
|
}
|
|
print("TRACK:", tailor.classify_track(job))
|
|
tracks, master = tailor.build_master(job)
|
|
print("TRACKS USED:", tracks, "| master chars:", len(master))
|
|
score, opinion = tailor.score_job(job)
|
|
print("SCORE:", score, "| OPINION:", opinion[:80])
|
|
t = tailor.tailor_resume(job)
|
|
print("TAILORED chars:", len(t), "| header:", t.split("\n")[0][:60])
|
|
subj = tailor.make_subject(job)
|
|
body = tailor.draft_email(job, t)
|
|
jid = db.upsert_job(job["title"], job["company"], "", "https://example.com/j1", "test", job["description"])
|
|
aid = db.create_application(jid, subject=subj, body=body)
|
|
checks = audit.run_audit(aid, db.get_job(jid), subj, body, t)
|
|
print("AUDIT:", [(c["item"], c["result"]) for c in checks])
|
|
print("ALL_PASS:", audit.all_pass(checks))
|
|
|
|
# 3. hydro classification test
|
|
hydro_job = {"title": "Head Grower", "description": "Hydroponic cultivation, IPM, greenhouse environment control, plant nutrition."}
|
|
print("HYDRO TRACK:", tailor.classify_track(hydro_job))
|
|
h_tracks, h_master = tailor.build_master(hydro_job)
|
|
print("HYDRO TRACKS USED:", h_tracks, "| has tech diff:", "Technical Differentiator" in h_master)
|