tests_kernel.base module — hid-tools documentation

# tests_kernel.base module

class BaseTestCase

  Bases: `object`

  class TestUhid

    Bases: `object`

    abs_event = InputEvent(EV_ABS, None, None)
    assertInputEvents(expected_events, effective_events)
    assertInputEventsIn(expected_events, effective_events)
    assertName(uhdev)
    check_taint()
    context(new_uhdev, request)
    create_device()
    classmethod debug_reports(reports, uhdev=None, events=None)
    hid_bpfs: list[HidBpf] = []
    kernel_modules: list[KernelModule] = []
    key_event = InputEvent(EV_KEY, None, None)
    load_hid_bpfs()
    load_kernel_module()
    msc_event = InputEvent(EV_MSC, MSC_SCAN, None)
    new_uhdev(load_kernel_module)
    rel_event = InputEvent(EV_REL, None, None)
    syn_event = InputEvent(EV_SYN, SYN_REPORT, None)
    test_creation()

      Make sure the device gets processed by the kernel and creates the expected application input node.

      If this fail, there is something wrong in the device report descriptors.

    unload_hid_bpfs()

class HIDTestUdevRule

  Bases: `object`

  create_udev_rule()
  classmethod instance()
  reload_udev_rules()

class HidBpf(object_name: str, has_rdesc_fixup: bool)

  Bases: `object`

  has_rdesc_fixup: bool
  object_name: str

class KernelModule(driver_name: str, module_name: str)

  Bases: `object`

  driver_name: str
  module_name: str

class UHIDTestDevice(name, application, rdesc_str=None, rdesc=None, input_info=None)

  Bases: `BaseDevice`

class UHIDTestGamepad(rdesc, application='Joystick', name=None, input_info=None)

  Bases: `BaseGamepad`

class UHIDTestJoystickGamepad(rdesc, application='Joystick', name=None, input_info=None)

  Bases: `JoystickGamepad`