test_python_driver.py 文件源码

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

项目:python-driver 作者: bblfsh 项目源码 文件源码
def _restart_data(self, format_: str='json') -> None:
        assert format_ == 'json'

        with open(join(CURDIR, 'data', 'helloworld.py')) as f:
            testcode = f.read()

        self.data = Request({
            'filepath': 'test.py',
            'action': 'ParseAST',
            'content': testcode,
            'language': 'python',
        })

        bufferclass = io.StringIO if format_ == 'json' else io.BytesIO

        # This will mock the python_driver stdin
        self.sendbuffer = bufferclass()
        # This will mock the python_driver stdout
        self.recvbuffer = bufferclass()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号