SPB Git

spb/wp45_uqo

Public
1.1 KB · 21 lines python
1from jof250 import parsing23def test_parse_synthetic_structure(synthetic_pdf):4    d = parsing.parse_pdf(synthetic_pdf, "syn_1", {"relpath": "synthetic.pdf", "bib_doi": "10.1111/jofi.99999", "article_type": "article"})5    assert d["metadata"]["title"] == "A Synthetic Test Article"6    assert d["abstract"] and "12.5%" in d["abstract"]7    heads = [s["heading"] for s in d["sections"]]8    assert any("Data and Methods" in h for h in heads) and any("Conclusion" in h for h in heads)9    assert d["stats"]["n_equations"] == 1 and d["equations"][0]["tag"] == "1"10    assert d["stats"]["n_tables"] == 1 and d["tables"][0]["label"] == "Table I"11    assert d["stats"]["n_references"] == 2 and d["references"][0]["year"] == "2098"12    assert d["markers"]["references_page"] == 113    assert 0 <= d["confidence"]["overall"] <= 1 and d["source_sha256"]1415def test_join_lines_dehyphenation():16    assert parsing.join_lines(["exoge-", "nous shocks"]) == "exogenous shocks"17    assert parsing.join_lines(["a", "b"]) == "a b"1819def test_roman():20    assert [parsing.roman_val(r) for r in ["I", "IV", "IX", "XII"]] == [1, 4, 9, 12]21
Files · b2ea7cd3a41b72854950b87ea6b3044f01e8a3c2
Menu

Theme