def test_borders(assert_pixels, assert_different_renderings, margin='10px',
                 prop='border'):
    """Test the rendering of borders"""
    source = '''
      <style>
        @page { size: 140px 110px }
        body { width: 100px; height: 70px; margin: %s; %s: 10px %s blue }
      </style>
      <body>'''

    # Do not test the exact rendering of earch border style but at least
    # check that they do not do the same.
    documents = (
        source % (margin, prop, border_style)
        for border_style in (
            'none', 'solid', 'dashed', 'dotted', 'double',
            'inset', 'outset', 'groove', 'ridge'))
    assert_different_renderings(*documents)

    css_margin = margin
    width = 140
    height = 110
    margin = 10
    border = 10
    solid_pixels = [['_'] * width for _ in range(height)]
    for x in range(margin, width - margin):
        for y in itertools.chain(
                range(margin, margin + border),
                range(height - margin - border, height - margin)):
            solid_pixels[y][x] = 'B'
    for y in range(margin, height - margin):
        for x in itertools.chain(
                range(margin, margin + border),
                range(width - margin - border, width - margin)):
            solid_pixels[y][x] = 'B'
    pixels = '\n'.join(''.join(chars) for chars in solid_pixels)
    html = source % (css_margin, prop, 'solid')
    assert_pixels(pixels, html)
Test the rendering of borders
tests/draw/test_box.py