Exemplo n.º 1
0
def test_keycode_not_found():
    with pytest.raises(ValueError):
        keycode.get_keycode('INVALID_KEYNAME')
Exemplo n.º 2
0
def assert_press(mocks, result_out, button_name, key_name):
    button_widget_name = '{0}'.format(button_name)
    mocks.uiroot.nametowidget(button_widget_name).process_event(None)
    keycode = get_keycode(key_name)
    mocks.device.press.assert_called_with(keycode, None)
    assert '.press({0}, None)'.format(keycode) in last_line(result_out)
Exemplo n.º 3
0
def test_keycode_of_digit():
    assert keycode.get_keycode('0') == 7
Exemplo n.º 4
0
def test_keycode_of_alphabet():
    assert keycode.get_keycode('a') == 29
Exemplo n.º 5
0
def test_keycode_of_specialkey_from_keyname():
    assert keycode.get_keycode('HOME') == 3
Exemplo n.º 6
0
def test_keycode_of_symbol_from_keyname():
    assert keycode.get_keycode('GRAVE') == 68
Exemplo n.º 7
0
def test_keycode_of_symbol_from_char():
    assert keycode.get_keycode('`') == 68