    def test_keyboard_event(self):
        """
        Check Keyboard event is consistent.
        """
        code = 123
        event = KeyboardEvent(code)
        self.assertEqual(event.key_code, code)
        self.assertIn(str(code), str(event))
Check Keyboard event is consistent.
tests/test_events.py