Draw a filled rectangle on a new page. Then extract the page's vector graphics and confirm that only one path was generated which has all the right properties.
()
| 125 | |
| 126 | |
| 127 | def test_2365(): |
| 128 | """Draw a filled rectangle on a new page. |
| 129 | |
| 130 | Then extract the page's vector graphics and confirm that only one path |
| 131 | was generated which has all the right properties.""" |
| 132 | doc = pymupdf.open() |
| 133 | page = doc.new_page() |
| 134 | rect = pymupdf.Rect(100, 100, 200, 200) |
| 135 | page.draw_rect( |
| 136 | rect, color=pymupdf.pdfcolor["black"], fill=pymupdf.pdfcolor["yellow"], width=3 |
| 137 | ) |
| 138 | paths = page.get_drawings() |
| 139 | assert len(paths) == 1 |
| 140 | path = paths[0] |
| 141 | assert path["type"] == "fs" |
| 142 | assert path["fill"] == pymupdf.pdfcolor["yellow"] |
| 143 | assert path["fill_opacity"] == 1 |
| 144 | assert path["color"] == pymupdf.pdfcolor["black"] |
| 145 | assert path["stroke_opacity"] == 1 |
| 146 | assert path["width"] == 3 |
| 147 | assert path["rect"] == rect |
| 148 | |
| 149 | |
| 150 | def test_2462(): |
nothing calls this directly
no test coverage detected
searching dependent graphs…