def test_clip_path_on_group(assert_pixels):
    assert_pixels('''
        _________
        _________
        __BBBB___
        __BRRRR__
        __BRRRR__
        __BRRRR__
        ___RRRR__
        _________
        _________
    ''', '''
      <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>
        <g clip-path="url(#clip)">
          <rect x="1" y="1" width="5" height="5" fill="blue" />
          <rect x="3" y="3" width="5" height="5" fill="red" />
        </g>
      </svg>
    ''')
,
tests/draw/svg/test_clip.py