Beispiel #1
0
def test_draws_object():
    dummy = mock.Mock()
    canvas = Canvas(gl=dummy)
    label = mock.Mock()
    label.draw = mock.MagicMock()
    canvas.objects['label'] = label
    canvas.window.on_draw()
    assert label.draw.called
Beispiel #2
0
def test_draw_line():
    mock_gl = mock.Mock()
    canvas = Canvas(gl=mock_gl)
    canvas.draw_line()
    assert len(canvas.objects) > 0
Beispiel #3
0
def test_label():
    mock_gl = mock.Mock()
    canvas = Canvas(gl=mock_gl)
    canvas.draw_label('Cool!')
    assert canvas.objects['Cool!']