def test_joystick_num_buttons(self): if self.jcount == 0: self.skipTest("no joysticks detected") for index in range(self.jcount): stick = joystick.joystick_open(index) self.assertIsInstance(stick, joystick.SDL_Joystick) buttons = joystick.joystick_num_buttons(stick) self.assertGreaterEqual(buttons, 0) joystick.joystick_close(stick)
def test_joystick_get_button(self): if self.jcount == 0: self.skipTest("no joysticks detected") for index in range(self.jcount): stick = joystick.joystick_open(index) for button in range(joystick.joystick_num_buttons(stick)): val = joystick.joystick_get_button(stick, button) self.assertIsInstance(val, bool) joystick.joystick_close(stick) pass