@requires_application()
def test_colorbar_draw():
 with TestingCanvas() as c:
  colorbar_top = create_colorbar(pos=(50, 50), size=(60, 4), orientation='top')
  c.draw_visual(colorbar_top)
  assert_image_approved(c.render(), 'visuals/colorbar/top.png')
  colorbar_top.parent = None
  colorbar_bottom = create_colorbar(pos=(50, 50), size=(60, 4), orientation='bottom')
  c.draw_visual(colorbar_bottom)
  assert_image_approved(c.render(), 'visuals/colorbar/bottom.png')
  colorbar_bottom.parent = None
  colorbar_left = create_colorbar(pos=(50, 50), size=(60, 4), orientation='left')
  c.draw_visual(colorbar_left)
  assert_image_approved(c.render(), 'visuals/colorbar/left.png')
  colorbar_left.parent = None
  colorbar_right = create_colorbar(pos=(50, 50), size=(60, 4), orientation='right')
  c.draw_visual(colorbar_right)
  assert_image_approved(c.render(), 'visuals/colorbar/right.png')

@ requires_application ( ) def test_colorbar_draw ( ) : with TestingCanvas ( ) as c : colorbar_top = create_colorbar ( pos = ( 50 , 50 ) , size = ( 60 , 4 ) , orientation = 'top' ) c . draw_visual ( colorbar_top ) assert_image_approved ( c . render ( ) , 'visuals/colorbar/top.png' ) colorbar_top . parent = None colorbar_bottom = create_colorbar ( pos = ( 50 , 50 ) , size = ( 60 , 4 ) , orientation = 'bottom' ) c . draw_visual ( colorbar_bottom ) assert_image_approved ( c . render ( ) , 'visuals/colorbar/bottom.png' ) colorbar_bottom . parent = None colorbar_left = create_colorbar ( pos = ( 50 , 50 ) , size = ( 60 , 4 ) , orientation = 'left' ) c . draw_visual ( colorbar_left ) assert_image_approved ( c . render ( ) , 'visuals/colorbar/left.png' ) colorbar_left . parent = None colorbar_right = create_colorbar ( pos = ( 50 , 50 ) , size = ( 60 , 4 ) , orientation = 'right' ) c . draw_visual ( colorbar_right ) assert_image_approved ( c . render ( ) , 'visuals/colorbar/right.png' )
test drawing colorbar without transform using colorbarvisual .