test(cv-qa): qualify long imported PDFs and cross-platform fidelity
This commit is contained in:
@@ -0,0 +1,66 @@
|
||||
"""Generate a separate labelled integration fixture; never mutate benchmark goldens."""
|
||||
import argparse
|
||||
import hashlib
|
||||
import json
|
||||
from pathlib import Path
|
||||
from docx import Document
|
||||
|
||||
|
||||
def generate(output):
|
||||
output.mkdir(parents=True, exist_ok=False)
|
||||
document = Document()
|
||||
document.add_paragraph('Name: Imported Åse Østergård')
|
||||
document.add_paragraph('Email: ase@example.test')
|
||||
document.add_paragraph('Phone: +47 400 00 002')
|
||||
document.add_paragraph('Location: Tromsø')
|
||||
document.add_paragraph('Headline: Senior software engineer')
|
||||
document.add_heading('Professional Summary', level=1)
|
||||
document.add_paragraph('Builds accessible software and documents explicit evidence. Synthetic integration fixture containing no personal career information.')
|
||||
document.add_heading('Work Experience', level=1)
|
||||
employers, titles, details = [], [], []
|
||||
for index in range(1, 13):
|
||||
title = f'Engineer {index:02d}'
|
||||
company = f'Synthetic Organisation {index:02d}'
|
||||
document.add_paragraph('Title: ' + title)
|
||||
document.add_paragraph('Company: ' + company)
|
||||
document.add_paragraph(f'{2010 + index} - {2011 + index}' if index < 12 else '2022 - Present')
|
||||
if index % 2 == 0:
|
||||
document.add_paragraph('Location: Tromsø')
|
||||
for bullet in range(1, 4):
|
||||
text = f'Record {index:02d} evidence {bullet}: Built and verified accessible workflow components, preserving approved information and explicit review decisions across independent document revisions.'
|
||||
document.add_paragraph(text, style='List Bullet')
|
||||
details.append(text)
|
||||
employers.append(company)
|
||||
titles.append(title)
|
||||
document.add_heading('Education', level=1)
|
||||
qualifications = ['Bachelor i informatikk', 'Master i programvaresystemer']
|
||||
for index, qualification in enumerate(qualifications):
|
||||
document.add_paragraph('Qualification: ' + qualification)
|
||||
document.add_paragraph('Institution: Example Learning Centre')
|
||||
document.add_paragraph(f'{2005 + index * 3} - {2008 + index * 3}')
|
||||
document.add_paragraph('Studied accessible systems, databases and source-grounded document workflows.', style='List Bullet')
|
||||
document.add_heading('Skills', level=1)
|
||||
skills = ['Python', 'C#', 'SQL', 'React', 'TypeScript', 'Docker'] + [f'ExplicitTool{index:02d}' for index in range(1, 55)]
|
||||
document.add_paragraph('; '.join(skills))
|
||||
document.add_heading('Languages', level=1)
|
||||
document.add_paragraph('Norsk: morsmål')
|
||||
document.add_paragraph('English: advanced')
|
||||
document.add_heading('Interests', level=1)
|
||||
document.add_paragraph('Friluftsliv og tilgjengelighet')
|
||||
file = output / 'long-labelled-integration.docx'
|
||||
document.save(file)
|
||||
expected = {'name': 'Imported Åse Østergård', 'employers': employers, 'titles': titles,
|
||||
'details': details, 'qualifications': qualifications, 'skills': skills,
|
||||
'markers': ['Imported Åse Østergård', 'Tromsø', 'ase@example.test', *employers, *titles, *details,
|
||||
*qualifications, 'Example Learning Centre', *skills, 'Norsk', 'morsmål', 'Friluftsliv og tilgjengelighet']}
|
||||
assert len(employers) == 12 and len(details) == 36 and len(skills) == 60
|
||||
(output / 'expected.json').write_text(json.dumps(expected, ensure_ascii=True, indent=2), encoding='utf-8')
|
||||
(output / 'manifest.json').write_text(json.dumps({'file': file.name, 'sha256': hashlib.sha256(file.read_bytes()).hexdigest(),
|
||||
'generatorSha256': hashlib.sha256(Path(__file__).read_bytes()).hexdigest(),
|
||||
'purpose': 'Separate connected multi-page import/render fixture, not added to frozen accuracy metrics.'}, indent=2))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
parser = argparse.ArgumentParser(description=__doc__)
|
||||
parser.add_argument('--output', type=Path, required=True)
|
||||
generate(parser.parse_args().output)
|
||||
Reference in New Issue
Block a user