diff --git a/pygameControls/tests/test_controller.py b/pygameControls/tests/test_controller.py index 76383a2..f667793 100644 --- a/pygameControls/tests/test_controller.py +++ b/pygameControls/tests/test_controller.py @@ -10,4 +10,22 @@ class TestController(unittest.TestCase): self.mock_js.get_name.return_value = "DualSense Wireless Controller" self.mock_js.get_guid.return_value = "030000004c0500000c0e000011010000" - self. \ No newline at end of file + self.controller = Controller(self.mock_js) + + def test_button_press(self): + self.assertEqual(self.controller.get_button(0), 1) + self.assertEqual(self.controller.get_button(1), 0) + + def test_axis_reading(self): + self.assertAlmostEqual(self.controller.get_axis(1), 0.5) + + def test_profile_mapping(self): + self.assertEqual(self.controller.get_mapping(), "Sony DualSense") + + def test_custom_config(self): + cfg = self.controller.get_custom_config() + self.assertIn("cross", cfg) + self.assertEqual(cfg["cross"], 0) + +if __name__ == "__main__": + unittest.main() \ No newline at end of file