Beispiel #1
0
def test_onscreentext_node_pos():
    text = OnscreenText()

    text.set_pos(1, 2, 3)
    assert text['pos'] == (0, 0)
    assert text.pos == (0, 0)
    assert text.getPos() == (0, 0)
    assert text.text_pos == (0, 0)
    assert text.getTextPos() == (0, 0)
    assert text.get_pos() == (1, 2, 3)
Beispiel #2
0
def test_onscreentext_text_pos():
    text = OnscreenText(pos=(1, 2))
    assert text['pos'] == (1, 2)
    assert text.pos == (1, 2)
    assert text.getPos() == (1, 2)
    assert text.text_pos == (1, 2)
    assert text.getTextPos() == (1, 2)
    assert text.get_pos() == (0, 0, 0)

    text.setTextPos(3, 4)
    assert text['pos'] == (3, 4)
    assert text.pos == (3, 4)
    assert text.getPos() == (3, 4)
    assert text.text_pos == (3, 4)
    assert text.getTextPos() == (3, 4)
    assert text.get_pos() == (0, 0, 0)

    text.text_pos = (7, 8)
    assert text['pos'] == (7, 8)
    assert text.pos == (7, 8)
    assert text.getPos() == (7, 8)
    assert text.text_pos == (7, 8)
    assert text.getTextPos() == (7, 8)
    assert text.get_pos() == (0, 0, 0)

    text.setPos(9, 10)
    assert text['pos'] == (9, 10)
    assert text.pos == (9, 10)
    assert text.getPos() == (9, 10)
    assert text.text_pos == (9, 10)
    assert text.getTextPos() == (9, 10)
    assert text.get_pos() == (0, 0, 0)

    text['pos'] = (11, 12)
    assert text['pos'] == (11, 12)
    assert text.pos == (11, 12)
    assert text.getPos() == (11, 12)
    assert text.text_pos == (11, 12)
    assert text.getTextPos() == (11, 12)
    assert text.get_pos() == (0, 0, 0)