Esempio n. 1
0
 def test_joystick_num_axes(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)
         axes = joystick.joystick_num_axes(stick)
         self.assertGreaterEqual(axes, 0)
         joystick.joystick_close(stick)
Esempio n. 2
0
 def test_joystick_get_axis(self):
     if self.jcount == 0:
         self.skipTest("no joysticks detected")
     for index in range(self.jcount):
         stick = joystick.joystick_open(index)
         for axis in range(joystick.joystick_num_axes(stick)):
             val = joystick.joystick_get_axis(stick, axis)
             self.assertTrue(-32768 <= val <= 32767)
         joystick.joystick_close(stick)