Esempio n. 1
0
def test_keyevent_to_string_for_colon():
    event = QKeyEvent(QEvent.KeyPress, Qt.Key_Colon, Qt.NoModifier, ":")
    assert eventhandler.keyevent_to_string(event) == "<colon>"
Esempio n. 2
0
def test_keyevent_to_string_for_alt_modifier_and_letter():
    event = QKeyEvent(QEvent.KeyPress, Qt.Key_A, Qt.AltModifier, "a")
    assert eventhandler.keyevent_to_string(event) == "<alt>a"
Esempio n. 3
0
def test_keyevent_to_string_for_only_modifier():
    event = QKeyEvent(QEvent.KeyPress, Qt.Key_Shift, Qt.ShiftModifier, "")
    assert eventhandler.keyevent_to_string(event) == ""
Esempio n. 4
0
def test_keyevent_to_string_for_control_modifier_and_letter():
    event = QKeyEvent(QEvent.KeyPress, Qt.Key_A, Qt.ControlModifier, "a")
    assert eventhandler.keyevent_to_string(event) == "<ctrl>a"
Esempio n. 5
0
def test_keyevent_to_string_for_special_key_with_shift():
    event = QKeyEvent(QEvent.KeyPress, Qt.Key_Tab, Qt.ShiftModifier, "\t")
    assert eventhandler.keyevent_to_string(event) == "<shift><tab>"
Esempio n. 6
0
def test_keyevent_to_string_for_special_key():
    event = QKeyEvent(QEvent.KeyPress, Qt.Key_Tab, Qt.NoModifier, "\t")
    assert eventhandler.keyevent_to_string(event) == "<tab>"
Esempio n. 7
0
def test_keyevent_to_string_for_uppercase_letter():
    event = QKeyEvent(QEvent.KeyPress, Qt.Key_A, Qt.ShiftModifier, "A")
    assert eventhandler.keyevent_to_string(event) == "A"
Esempio n. 8
0
def test_keyevent_to_string_for_lowercase_letter():
    event = QKeyEvent(QEvent.KeyPress, Qt.Key_A, Qt.NoModifier, "a")
    assert eventhandler.keyevent_to_string(event) == "a"