test_jupyter_websocket.py 文件源码

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

项目:enterprise_gateway 作者: jupyter-incubator 项目源码 文件源码
def test_seed_language_support(self):
        """Kernel should have variables preseeded from notebook."""
        ws = yield self.spawn_kernel()

        if sys.version_info.major == 2:
            code = 'print this.s'
        else:
            code = 'print(this.s)'

        # Print the encoded "zen of python" string, the kernel should have
        # it imported
        req = self.execute_request(code)
        ws.write_message(json_encode(req))
        content = yield self.await_stream(ws)
        self.assertEqual(content['name'], 'stdout')
        self.assertIn('Gur Mra bs Clguba', content['text'])

        ws.close()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号