Skip to content

Commit

Permalink
tests: allow a different default document unit for SVGSurface
Browse files Browse the repository at this point in the history
It was changed upstream, despite being documented.

See https://gitlab.freedesktop.org/cairo/cairo/-/issues/545
  • Loading branch information
lazka committed Mar 19, 2022
1 parent 807241f commit 678edd9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tests/test_surface.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,10 @@ def test_svg_version_to_string():
reason="too old cairo")
def test_svg_surface_get_document_unit():
with cairo.SVGSurface(None, 10, 10) as surface:
assert surface.get_document_unit() == cairo.SVGUnit.PT
# https://gitlab.freedesktop.org/cairo/cairo/-/issues/545
assert surface.get_document_unit() in [cairo.SVGUnit.PT, cairo.SVGUnit.USER]

with cairo.SVGSurface(None, 10, 10) as surface:
surface.set_document_unit(cairo.SVGUnit.PX)
assert surface.get_document_unit() == cairo.SVGUnit.PX
with pytest.raises(cairo.Error):
Expand Down

0 comments on commit 678edd9

Please sign in to comment.