| 50 | |
| 51 | |
| 52 | def 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 | |
| 72 | def test_pdf(): |