test_pyq.py 文件源码

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

项目:pyq 作者: caioariede 项目源码 文件源码
def test_call_arg_kwarg(self):
        matches1 = list(self.m.match('call[kwarg=a]',
                        self.filepath('calls.py')))
        matches2 = list(self.m.match('call[kwarg=x]',
                        self.filepath('calls.py')))
        matches3 = list(self.m.match('call[arg=bar]',
                        self.filepath('calls.py')))
        matches4 = list(self.m.match('[arg=bang]', self.filepath('calls.py')))

        self.assertEqual(len(matches1), 1)
        self.assertEqual(len(matches2), 2)
        self.assertEqual(len(matches3), 2)
        self.assertEqual(len(matches4), 2)

        self.assertIsInstance(matches1[0][0], ast.Call)
        self.assertIsInstance(matches2[0][0], ast.Call)
        self.assertIsInstance(matches2[1][0], ast.Call)
        self.assertIsInstance(matches3[0][0], ast.Call)
        self.assertIsInstance(matches3[1][0], ast.Call)
        self.assertIsInstance(matches4[0][0], ast.Call)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号