MCPcopy Create free account
hub / github.com/pymupdf/PyMuPDF / test_quad

Function test_quad

tests/test_geometry.py:294–319  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

292
293
294def test_quad():
295 r = pymupdf.Rect(10, 10, 20, 20)
296 q = r.quad
297 assert q.is_rectangular
298 assert not q.is_empty
299 assert q.is_convex
300 q *= pymupdf.Matrix(1, 1).preshear(2, 3)
301 assert not q.is_rectangular
302 assert not q.is_empty
303 assert q.is_convex
304 assert r.tl not in q
305 assert r not in q
306 assert r.quad not in q
307 failed = False
308 try:
309 q[5] = pymupdf.Point()
310 except:
311 failed = True
312 assert failed
313
314 failed = False
315 try:
316 q /= (1, 0, 1, 0, 1, 0)
317 except:
318 failed = True
319 assert failed
320
321
322def test_pageboxes():

Callers

nothing calls this directly

Calls 1

preshearMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…