예제 #1
0
def test_press_home():
    cls = KeyEvent()
    press_keycode = MagicMock()
    cls.press_keycode = MagicMock()
    cls.press_keycode.return_value = True
    result = cls.press_keycode("home")
    print(result)
예제 #2
0
def test_press_volume_up():
    cls = KeyEvent()
    press_keycode = MagicMock()
    cls.press_keycode = MagicMock()
    cls.press_keycode.return_value = True
    result = cls.press_keycode("volume_up")
    print(result)
    assert result == True
예제 #3
0
def test_press_search():
    cls = KeyEvent()
    press_keycode = MagicMock()
    cls.press_keycode = MagicMock()
    cls.press_keycode.return_value = True
    result = cls.press_keycode("search")
    print(result)
    assert result == True
예제 #4
0
def test_press():
    cls = KeyEvent()
    press_keycode = MagicMock()
    cls.press_keycode = MagicMock()
    cls.press_keycode.return_value = True
    result = cls.press_keycode(0x07, 0x02)
    print(result)
    assert result == True
예제 #5
0
def test_press_with_device():
    cls = KeyEvent()
    press_keycode = MagicMock()
    cls.press_keycode = MagicMock()
    cls.press_keycode.return_value = True
    result = cls.press_keycode("volume_down", device=MagicMock())