def test_patching_std_streams(self):
"""
Test if std streams are correctly redirected to the web-console
"""
self.stdin.send_keys('n')
self.send_btn.click()
time.sleep(1)
stdout_tag = self.browser.find_element_by_id('stdout')
self.assertIn('Enter something:', stdout_tag.text)
self.stdin.send_keys('spam')
self.send_btn.click()
time.sleep(1)
self.stdin.send_keys('n')
self.send_btn.click()
time.sleep(1)
self.assertIn('You have entered: spam', stdout_tag.text)
评论列表
文章目录