MCPcopy Index your code
hub / github.com/Layout-Parser/layout-parser / test_csv

Function test_csv

tests/test_io.py:52–69  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

50
51
52def test_csv():
53 i = Interval(1, 2, "y", canvas_height=5)
54 r = Rectangle(1, 2, 3, 4)
55 q = Quadrilateral(np.arange(8).reshape(4, 2), 200, 400)
56 l = Layout([i, r, q], page_data={"width": 200, "height": 200})
57
58 _l = load_csv("tests/fixtures/io/layout.csv")
59 assert _l != l
60 _l.page_data = {"width": 200, "height": 200}
61 assert _l == l
62
63 i2 = i # <- Allow mixmode loading
64 r2 = TextBlock(r, id=24)
65 q2 = TextBlock(q, text="test", parent=45)
66 l2 = Layout([i2, r2, q2])
67
68 _l2 = load_csv("tests/fixtures/io/layout_textblock.csv")
69 assert _l2 == l2
70
71
72def test_pdf():

Callers

nothing calls this directly

Calls 6

IntervalClass · 0.90
RectangleClass · 0.90
QuadrilateralClass · 0.90
LayoutClass · 0.90
load_csvFunction · 0.90
TextBlockClass · 0.90

Tested by

no test coverage detected