Correct independent developer start year to 2017
This commit is contained in:
@@ -148,7 +148,7 @@ em { font-style: italic; }
|
||||
|
||||
|
||||
def is_date_text(text):
|
||||
return re.fullmatch(r"[A-Za-z]+ \d{4} - (?:[A-Za-z]+ \d{4}|Present)", text.strip()) is not None
|
||||
return re.fullmatch(r"(?:[A-Za-z]+ )?\d{4} - (?:(?:[A-Za-z]+ )?\d{4}|Present)", text.strip()) is not None
|
||||
|
||||
|
||||
def is_date_paragraph(node):
|
||||
|
||||
@@ -21,8 +21,8 @@ def normalized(text):
|
||||
class AutofillResumeTests(unittest.TestCase):
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
cls.source = (ROOT / "resumes/resume-v24.md").read_text(encoding="utf-8")
|
||||
cls.html = (ROOT / "resumes/resume-v24.html").read_text(encoding="utf-8")
|
||||
cls.source = (ROOT / "resumes/resume-v26.md").read_text(encoding="utf-8")
|
||||
cls.html = (ROOT / "resumes/resume-v26.html").read_text(encoding="utf-8")
|
||||
tree = ET.fromstring("<div>" + markdown.markdown(
|
||||
cls.source, extensions=["extra"], output_format="xhtml") + "</div>")
|
||||
cls.expected = normalized("".join(tree.itertext()))
|
||||
@@ -41,7 +41,7 @@ class AutofillResumeTests(unittest.TestCase):
|
||||
"Clarity Diagnostics & Lab Solutions", "MyTap, aka Which Craft",
|
||||
"TriCore Reference Laboratories", "Desert Digital Consulting"])
|
||||
self.assertEqual([g.findall("p")[-1].find("em").text for g in work], [
|
||||
"June 2024 - Present", "January 2022 - April 2024",
|
||||
"2017 - Present", "January 2022 - April 2024",
|
||||
"April 2021 - July 2022", "September 2020 - January 2022",
|
||||
"January 2016 - April 2020", "April 2013 - January 2017",
|
||||
"October 2010 - January 2021"])
|
||||
@@ -59,13 +59,13 @@ class AutofillResumeTests(unittest.TestCase):
|
||||
self.assertIn(name, "".join(project.itertext()))
|
||||
self.assertEqual(project.findall(".//h3"), [])
|
||||
self.assertEqual(project.findall(".//ul"), [])
|
||||
doc = Document(ROOT / "resumes/resume-v24.docx")
|
||||
doc = Document(ROOT / "resumes/resume-v26.docx")
|
||||
for name in names:
|
||||
paragraph = next(p for p in doc.paragraphs if name in p.text)
|
||||
self.assertEqual(paragraph.style.name, "List Bullet")
|
||||
|
||||
def test_two_pdf_extractors_preserve_all_text_in_order(self):
|
||||
path = ROOT / "resumes/resume-v24.pdf"
|
||||
path = ROOT / "resumes/resume-v26.pdf"
|
||||
with pymupdf.open(path) as doc:
|
||||
self.assertEqual(normalized("".join(p.get_text() for p in doc)), self.expected)
|
||||
for page in doc:
|
||||
@@ -77,18 +77,18 @@ class AutofillResumeTests(unittest.TestCase):
|
||||
self.expected)
|
||||
|
||||
def test_word_body_preserves_all_text(self):
|
||||
doc = Document(ROOT / "resumes/resume-v24.docx")
|
||||
doc = Document(ROOT / "resumes/resume-v26.docx")
|
||||
self.assertEqual(normalized("".join(p.text for p in doc.paragraphs)), self.expected)
|
||||
self.assertEqual(len(doc.tables), 0)
|
||||
self.assertFalse(any(p.text for section in doc.sections for p in section.header.paragraphs))
|
||||
self.assertFalse(any(p.text for section in doc.sections for p in section.footer.paragraphs))
|
||||
|
||||
def test_organization_dates_degree_and_references(self):
|
||||
doc = Document(ROOT / "resumes/resume-v24.docx")
|
||||
doc = Document(ROOT / "resumes/resume-v26.docx")
|
||||
for company in ("Desert Digital Consulting", "Covius, LLC", "University of New Mexico"):
|
||||
paragraph = next(p for p in doc.paragraphs if p.text == company)
|
||||
self.assertTrue(all(run.italic for run in paragraph.runs if run.text.strip()))
|
||||
for date in ("October 2010 - January 2021", "September 2003 - September 2008"):
|
||||
for date in ("2017 - Present", "October 2010 - January 2021", "September 2003 - September 2008"):
|
||||
paragraph = next(p for p in doc.paragraphs if p.text == date)
|
||||
for run in paragraph.runs:
|
||||
self.assertEqual(run.font.size.pt, 9)
|
||||
|
||||
Reference in New Issue
Block a user