test_ioctl.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:python-ioctl 作者: olavmrk 项目源码 文件源码
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)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号