Exemplo n.º 1
0
def test_Is_Marked_For_Deletion_After_Animation_Complete():
    a = Animation([1, 2, 3])
    assert a.markedForDeletion == False
    a.Run()  # Frame 1
    assert a.markedForDeletion == False
    a.Run()  # Frame 2
    assert a.markedForDeletion == False
    a.Run()  # Frame 3
    assert a.markedForDeletion == True
Exemplo n.º 2
0
def test_Will_Loop_If_Marked_For_Looping():
    a = Animation([1, 2, 3])
    a.SetLooping(True)
    assert a.currentFrame == 0
    a.Run()
    assert a.currentFrame == 1
    a.Run()
    assert a.currentFrame == 2
    a.Run()
    assert a.currentFrame == 0
Exemplo n.º 3
0
def test_Can_Run_With_Frame_List():
    a = Animation([1, 2, 3])
    a.Run()
    assert True
Exemplo n.º 4
0
def test_Cannot_Run_With_Empty_Frames_List():
    a = Animation([])
    with pytest.raises(IndexError):
        a.Run()