76 lines
2.8 KiB
Python
76 lines
2.8 KiB
Python
from admin_analytics.scraper.classify import classify_title, is_overhead
|
|
|
|
|
|
def test_grants_analyst():
|
|
assert classify_title("Grants Analyst II") == "GRANTS_ADMIN"
|
|
assert classify_title("Senior Grants Analyst") == "GRANTS_ADMIN"
|
|
assert classify_title("Manager, Grant Administration, Pre-Award") == "GRANTS_ADMIN"
|
|
assert classify_title("Closeout Coordinator, Research") == "GRANTS_ADMIN"
|
|
|
|
|
|
def test_research_staff():
|
|
assert classify_title("Research Associate") == "RESEARCH"
|
|
assert classify_title("Associate Scientist") == "RESEARCH"
|
|
assert classify_title("Computer Scientist NIST") == "RESEARCH"
|
|
assert classify_title("Postdoctoral Researcher") == "RESEARCH"
|
|
|
|
|
|
def test_academic_support():
|
|
assert classify_title("Undergraduate Academic Advisor") == "ACADEMIC_SUPPORT"
|
|
assert classify_title("Graduate Services Coordinator") == "ACADEMIC_SUPPORT"
|
|
assert classify_title("Academic Program Manager") == "ACADEMIC_SUPPORT"
|
|
|
|
|
|
def test_admin_support():
|
|
assert classify_title("Administrative Assistant IV") == "ADMIN_SUPPORT"
|
|
assert classify_title("Administrative Specialist") == "ADMIN_SUPPORT"
|
|
|
|
|
|
def test_it():
|
|
assert classify_title("Computing Support Specialist II") == "IT"
|
|
assert classify_title("Systems Programmer IV") == "IT"
|
|
assert classify_title("Director of Computing Operations") == "IT"
|
|
|
|
|
|
def test_finance():
|
|
assert classify_title("Financial Specialist") == "FINANCE"
|
|
assert classify_title("Director, Procurement & Financial Processing") == "FINANCE"
|
|
assert classify_title("Sr. Business Officer") == "FINANCE"
|
|
|
|
|
|
def test_leadership():
|
|
assert classify_title("Dean") == "LEADERSHIP"
|
|
assert classify_title("Associate Dean for Academic Affairs") == "LEADERSHIP"
|
|
assert classify_title("Chief of Staff") == "LEADERSHIP"
|
|
|
|
|
|
def test_communications():
|
|
assert classify_title("Communications Director") == "COMMUNICATIONS"
|
|
assert classify_title("Digital Communications Specialist") == "COMMUNICATIONS"
|
|
|
|
|
|
def test_technical():
|
|
assert classify_title("Master Machinist") == "TECHNICAL"
|
|
assert classify_title("Lab Manager") == "TECHNICAL"
|
|
assert classify_title("Lab Coordinator II") == "TECHNICAL"
|
|
|
|
|
|
def test_faculty_not_admin():
|
|
assert classify_title("Adjunct Professor NIST") == "FACULTY"
|
|
assert classify_title("Affiliated Associate Professor") == "FACULTY"
|
|
|
|
|
|
def test_overhead_classification():
|
|
assert is_overhead("LEADERSHIP") is True
|
|
assert is_overhead("FINANCE") is True
|
|
assert is_overhead("IT") is True
|
|
assert is_overhead("RESEARCH") is False
|
|
assert is_overhead("ACADEMIC_SUPPORT") is False
|
|
assert is_overhead("TECHNICAL") is False
|
|
assert is_overhead("GRANTS_ADMIN") is None # debatable
|
|
|
|
|
|
def test_unknown():
|
|
assert classify_title("Football Coach") == "UNKNOWN"
|
|
assert classify_title(None) == "UNKNOWN"
|
|
assert classify_title("") == "UNKNOWN"
|