def test_label_painter():
    image = data.camera()
    moon = data.moon()
    viewer = ImageViewer(image)
    lp = LabelPainter()
    viewer += lp

    assert_equal(lp.radius, 5)
    lp.label = 1
    assert_equal(str(lp.label), '1')
    lp.label = 2
    assert_equal(str(lp.paint_tool.label), '2')
    assert_equal(lp.paint_tool.radius, 5)
    lp._on_new_image(moon)
    assert_equal(lp.paint_tool.shape, moon.shape)
def test_label_painter():
    image = data.camera()
    moon = data.moon()
    viewer = ImageViewer(image)
    lp = LabelPainter()
    viewer += lp

    assert_equal(lp.radius, 5)
    lp.label = 1
    assert_equal(str(lp.label), '1')
    lp.label = 2
    assert_equal(str(lp.paint_tool.label), '2')
    assert_equal(lp.paint_tool.radius, 5)
    lp._on_new_image(moon)
    assert_equal(lp.paint_tool.shape, moon.shape)