Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix #1439.
- Loading branch information
Showing
3 changed files
with
51 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
""" | ||
weasyprint.tests.test_draw.svg.test_defs | ||
---------------------------------------- | ||
Test how SVG definitions are drawn. | ||
""" | ||
|
||
from ...testing_utils import assert_no_logs | ||
from .. import assert_pixels | ||
|
||
|
||
@assert_no_logs | ||
def test_use(): | ||
assert_pixels('use', 10, 10, ''' | ||
RRRRR_____ | ||
RRRRR_____ | ||
__________ | ||
___RRRRR__ | ||
___RRRRR__ | ||
__________ | ||
_____RRRRR | ||
_____RRRRR | ||
__________ | ||
__________ | ||
''', ''' | ||
<style> | ||
@page { size: 10px } | ||
svg { display: block } | ||
</style> | ||
<svg width="10px" height="10px" xmlns="http://www.w3.org/2000/svg" | ||
xlink="http://www.w3.org/1999/xlink"> | ||
<defs> | ||
<rect id="rectangle" width="5" height="2" fill="red" /> | ||
</defs> | ||
<use xlink:href="#rectangle" /> | ||
<use xlink:href="#rectangle" x="3" y="3" /> | ||
<use xlink:href="#rectangle" x="5" y="6" /> | ||
</svg> | ||
''') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters