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()
test_jupyter_websocket.py 文件源码
python
阅读 25
收藏 0
点赞 0
评论 0
评论列表
文章目录