mirror of
https://github.com/Kozea/WeasyPrint.git
synced 2024-10-04 07:57:52 +03:00
59 lines
1.4 KiB
Python
59 lines
1.4 KiB
Python
"""
|
|
weasyprint.tests.test_draw.test_column
|
|
--------------------------------------
|
|
|
|
Test how columns are drawn.
|
|
|
|
"""
|
|
|
|
from ..testing_utils import assert_no_logs
|
|
from . import assert_pixels
|
|
|
|
|
|
@assert_no_logs
|
|
def test_column_rule_1():
|
|
assert_pixels('solid', 5, 3, '''
|
|
a_r_a
|
|
a_r_a
|
|
_____
|
|
''', '''
|
|
<style>
|
|
img { display: inline-block; width: 1px; height: 1px }
|
|
div { columns: 2; column-rule-style: solid;
|
|
column-rule-width: 1px; column-gap: 3px;
|
|
column-rule-color: red }
|
|
body { margin: 0; font-size: 0; background: white}
|
|
@page { margin: 0; size: 5px 3px }
|
|
</style>
|
|
<div>
|
|
<img src=blue.jpg>
|
|
<img src=blue.jpg>
|
|
<img src=blue.jpg>
|
|
<img src=blue.jpg>
|
|
</div>''')
|
|
|
|
|
|
@assert_no_logs
|
|
def test_column_rule_2():
|
|
assert_pixels('dotted', 5, 3, '''
|
|
a_r_a
|
|
a___a
|
|
a_r_a
|
|
''', '''
|
|
<style>
|
|
img { display: inline-block; width: 1px; height: 1px }
|
|
div { columns: 2; column-rule-style: dotted;
|
|
column-rule-width: 1px; column-gap: 3px;
|
|
column-rule-color: red }
|
|
body { margin: 0; font-size: 0; background: white}
|
|
@page { margin: 0; size: 5px 3px }
|
|
</style>
|
|
<div>
|
|
<img src=blue.jpg>
|
|
<img src=blue.jpg>
|
|
<img src=blue.jpg>
|
|
<img src=blue.jpg>
|
|
<img src=blue.jpg>
|
|
<img src=blue.jpg>
|
|
</div>''')
|