def test_generate_ps3_controller_joystick(self): controllers = controllersConfig.loadControllerConfig( 0, PS3UUID, "p1controller", "", -1, 0, "p2controller", "", -1, 0, "p3controller", "", -1, 0, "p4controller", "") config = fba2xControllers.generateControllerConfig( "1", controllers["1"]) self.assertEquals(config['JA_UD_1'], '1') self.assertEquals(config['JA_LR_1'], '0')
def test_generate_ps3_controller_specials(self): controllers = controllersConfig.loadControllerConfig( 0, PS3UUID, "p1controller", "", -1, 0, "p2controller", "", -1, 0, "p3controller", "", -1, 0, "p4controller", "") config = fba2xControllers.generateControllerConfig( "1", controllers["1"]) self.assertEquals(config['HOTKEY'], '16') self.assertEquals(config['QUIT'], '3')
def test_generate_only_axis_controller_doesnt_put_zero_in_directions(self): controllers = controllersConfig.loadControllerConfig( 0, GPIOUUID, "p1controller", "", -1, 0, "p2controller", "", -1, 0, "p3controller", "", -1, 0, "p4controller", "") config = fba2xControllers.generateControllerConfig( "1", controllers["1"], True) self.assertFalse('RIGHT_1' in config) self.assertFalse('LEFT_1' in config) self.assertFalse('UP_1' in config) self.assertFalse('DOWN_1' in config)
def test_generate_ps3_controller_directions(self): controllers = controllersConfig.loadControllerConfig( 0, PS3UUID, "p1controller", "", -1, 0, "p2controller", "", -1, 0, "p3controller", "", -1, 0, "p4controller", "") config = fba2xControllers.generateControllerConfig( "1", controllers["1"]) self.assertEquals(config['UP_1'], '4') self.assertEquals(config['DOWN_1'], '6') self.assertEquals(config['LEFT_1'], '7') self.assertEquals(config['RIGHT_1'], '5')
def test_generate_ps3_controller_6buttons(self): controllers = controllersConfig.loadControllerConfig( 0, PS3UUID, "p1controller", "", -1, 0, "p2controller", "", -1, 0, "p3controller", "", -1, 0, "p4controller", "") config = fba2xControllers.generateControllerConfig( "1", controllers["1"], True) self.assertEquals(config['X_1'], '12') self.assertEquals(config['Y_1'], '14') self.assertEquals(config['A_1'], '15') self.assertEquals(config['B_1'], '10') self.assertEquals(config['L_1'], '13') self.assertEquals(config['R_1'], '11')
def test_generate_simple_controller(self): config = fba2xControllers.generateControllerConfig('1', basicController1) self.assertEquals(config['Y_1'], '10')