def test_get_oauth_verifier_browser_error():
def error(url):
raise RuntimeError
stream = io.StringIO()
url = "https://api.twitter.com/oauth/authorize?oauth_token=abc"
with patch.object(oauth_dance.asyncio, 'sleep', side_effect=dummy):
with patch.object(oauth_dance.webbrowser, 'open', side_effect=error):
with patch.object(oauth_dance, 'input', return_value="12345"):
with redirect_stdout(stream):
await oauth_dance.get_oauth_verifier("abc")
stream.seek(0)
assert url in stream.read()
评论列表
文章目录