def test_clip_path(assert_pixels):
    assert_pixels('''
        _________
        _________
        __RRRRR__
        __RBBBR__
        __RBBBR__
        __RBBBR__
        __RRRRR__
        _________
        _________
    ''', '''
      <style>
        @page { size: 9px }
        svg { display: block }
      </style>
      <svg width="9px" height="9px" xmlns="http://www.w3.org/2000/svg">
        <defs>
          <clipPath id="clip">
            <rect x="2" y="2" width="5" height="5" />
          </clipPath>
        </defs>
        <rect x="2" y="2" width="5" height="5" stroke-width="2"
              stroke="red" fill="blue" clip-path="url(#clip)" />
      </svg>
    ''')
,
tests/draw/svg/test_clip.py