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)
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
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
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
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())