示例#1
0
文件: test_app.py 项目: ninelb/forget
    def test_start_auth(self):
        with patch("flask_app.app.get_oauth_client") as client:
            client().request.return_value = ({'status': '200'}, "oauth_token=123&oauth_token_secret=xyz")
            assert 302 == app.start_auth().status_code

            assert app.session['oauth_token'] == '123'
            assert app.session['oauth_token_secret'] == 'xyz'
示例#2
0
文件: test_app.py 项目: ninelb/forget
 def test_start_auth_bad_response(self):
     with patch("flask_app.app.get_oauth_client") as client:
         with pytest.raises(Exception):
             client().request.return_value = ({'status': None}, None)
             app.start_auth()