test_xkb.py 文件源码

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

项目:python-xkbcommon 作者: sde1000 项目源码 文件源码
def test_keymap_new_from_buffer(self):
        ctx = xkb.Context()
        if six.PY2:
            typecode = b'b'
        else:
            typecode = 'b'
        test_data = array.array(typecode, sample_keymap_bytes)
        km = ctx.keymap_new_from_buffer(test_data)
        self.assertIsNotNone(km)
        self.assertEqual(km.load_method, "buffer")
        test_data.extend([0] * 10)
        length = len(sample_keymap_bytes)
        km = ctx.keymap_new_from_buffer(test_data, length=length)
        self.assertIsNotNone(km)

# This class makes use of the details of the sample keymap in
# sample_keymap_string.
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号