def test_is_controller(self): for i in range(controller.get_count()): if controller.is_controller(i): c = controller.Controller(i) self.assertIsInstance(c, controller.Controller) c.quit() else: with self.assertRaises(pygame._sdl2.sdl2.error): c = controller.Controller(i) with self.assertRaises(TypeError): controller.is_controller('Test')
def _get_first_controller(self): for i in range(controller.get_count()): if controller.is_controller(i): return controller.Controller(i)