test_interaction.py 文件源码

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

项目:http-prompt 作者: eliangcs 项目源码 文件源码
def test_vi_mode(self):
        self.write_config('vi = True\n')

        bin_path = get_http_prompt_path()
        child = pexpect.spawn(bin_path, env=os.environ)

        child.expect_exact('http://localhost:8000> ')

        # Enter 'htpie', switch to command mode (ESC),
        # move two chars left (hh), and insert (i) a 't'
        child.send('htpie')
        child.send('\x1b')
        child.sendline('hhit')

        child.expect_exact('http http://localhost:8000')

        # Enter 'exit'
        child.send('\x1b')
        child.send('i')
        child.sendline('exit')

        child.expect_exact('Goodbye!', timeout=20)
        child.close()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号