def test_ioctl_fn_ptr_w(self, ioctl_mock):
def _handle_ioctl(fd, request, int_ptr):
assert fd == 12
assert request == 32
assert type(int_ptr) == ctypes.POINTER(ctypes.c_int)
assert int_ptr.contents.value == 42
return mock.DEFAULT
ioctl_mock.side_effect = _handle_ioctl
fn = ioctl.ioctl_fn_ptr_w(32, ctypes.c_int)
fn(12, 42)
评论列表
文章目录