Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- tests/test_apigee.py ... [ 2%]
- tests/test_chatbot.py ...F...F. [ 11%]
- tests/test_oauth.py .....F...F.FF [ 24%]
- tests/test_oauth_utils.py ................. [ 41%]
- tests/test_user.py ................................................... [ 92%]
- tests/test_utils.py . [ 93%]
- tests/test_vaporizer.py ....... [100%]
- =================================== FAILURES ===================================
- ________________ ChatbootGoogleCallbackTestCase.test_valid_code ________________
- self = <tests.test_chatbot.ChatbootGoogleCallbackTestCase testMethod=test_valid_code>
- mock_authorized_response = <MagicMock name='authorized_response' id='140269010711888'>
- mock_get = <MagicMock name='get' id='140269010713736'>
- @patch("auth.oauth.providers.google.get")
- @patch("auth.oauth.providers.google.authorized_response")
- def test_valid_code(self, mock_authorized_response, mock_get):
- # token returned from google api
- mock_authorized_response.return_value = {
- "expires_in": 3600,
- "id_token": ("eyJhbGciOiJSUzI1NiIsImtpZCI6IjRiMTRiZWFkODZmZjBhZDRlZTAxZWFkYWUwNzBk" "YjM3YWE2YzY2Y2QifQ."),
- "token_type": "Bearer",
- "access_token": ("ya29.Ci9IA92ZqnIAgf3BUqMPkIW8X4NDB9JCu12ZsV5h902nGig5xj5Ix8WVzjy1ht3s2Q"),
- }
- # user info returner from google api
- class UserInfo(object):
- data = {
- "locale": "en",
- "family_name": "Koci",
- "given_name": "Pavel",
- "name": "Pavel Koci",
- "id": "10974864908507278145",
- "email": "pavel.koci@vacuumapps.com",
- "verified_email": True,
- "picture": "https://lh3.googleusercontent.com/-rscbv5M/photo.jpg",
- "hd": "vacuumapps.com",
- }
- mock_get.return_value = UserInfo()
- url = "/v1/chatbot.google.authorized?state={}&" "code=4%2FVq84MGCyFcHuS-1tj7gpm9hbd81NhhW6eAfMN6TSb2o".format(
- "YXBwX2lkOjpodHRwOi8vd3d3Lmtpd2kuY29tOjpodHRwczovL2dyYXBoLmZhY2Vib29rLmNvbTo6bGlua190b2tlbg%3D%3D"
- )
- response = self.client.get(url)
- > self.assertEqual(response.status_code, 302)
- E AssertionError: 500 != 302
- tests/test_chatbot.py:101: AssertionError
- ----------------------------- Captured stdout call -----------------------------
- 2019-03-14T17:03:43.725659Z [info ] request client_addr=127.0.0.1 forwarding= method=GET path=/v1/chatbot.google.authorized request_id=ab8e4e778100464e93d0383413eb1530
- 2019-03-14T17:03:43.748154Z [info ] oauth.redirect_url is_invalid=False request_id=ab8e4e778100464e93d0383413eb1530 url=http://www.kiwi.com
- 2019-03-14T17:03:43.749473Z [info ] parse_google_data.start data={"email": "pavel.koci@vacuumapps.com", "family_name": "Koci", "given_name": "Pavel", "hd": "vacuumapps.com", "id": "10974864908507278145", "locale": "en", "name": "Pavel Koci", "picture": "https://lh3.googleusercontent.com/-rscbv5M/photo.jpg", "verified_email": true} request_id=ab8e4e778100464e93d0383413eb1530
- 2019-03-14T17:03:43.750182Z [info ] parse_google_data.finish data={"email": "pavel.koci@vacuumapps.com", "email_verified": true, "first_name": "Pavel", "last_name": "Koci"} request_id=ab8e4e778100464e93d0383413eb1530
- 2019-03-14T17:03:43.859638Z [info ] response length=56 request_id=ab8e4e778100464e93d0383413eb1530 status=500
- ----------------------------- Captured stderr call -----------------------------
- 2019-03-14T17:03:42.415337Z [info ] stdlib_log [flask.app] message=initializing trace middleware request_id=71c27243d8ff4a6db1463626d79202f8
- 2019-03-14T17:03:42.426225Z [debug ] stdlib_log [ddtrace.encoding] message=using Msgpack encoder request_id=71c27243d8ff4a6db1463626d79202f8
- 2019-03-14T17:03:42.426732Z [info ] stdlib_log [ddtrace.sampler] message=initialized RateSampler, sample 100.0% of traces request_id=71c27243d8ff4a6db1463626d79202f8
- 2019-03-14T17:03:42.434032Z [debug ] stdlib_log [ddtrace.writer] message=resetting queues. pids(old:None new:68) request_id=71c27243d8ff4a6db1463626d79202f8
- 2019-03-14T17:03:42.434477Z [debug ] stdlib_log [ddtrace.writer] message=starting flush thread request_id=71c27243d8ff4a6db1463626d79202f8
- 2019-03-14T17:03:42.927535Z [error ] stdlib_log [ddtrace.writer] message=cannot send spans to localhost:8126: [Errno 99] Address not available
- 2019-03-14T17:03:42.932513Z [error ] stdlib_log [ddtrace.writer] message=cannot send services to localhost:8126: [Errno 99] Address not available
- 2019-03-14T17:03:43.442194Z [error ] stdlib_log [ddtrace.writer] message=cannot send spans to localhost:8126: [Errno 99] Address not available
- 2019-03-14T17:03:43.448537Z [error ] stdlib_log [ddtrace.writer] message=cannot send services to localhost:8126: [Errno 99] Address not available
- ------------------------------ Captured log call -------------------------------
- middleware.py 31 INFO initializing trace middleware
- encoding.py 77 DEBUG using Msgpack encoder
- sampler.py 41 INFO initialized RateSampler, sample 100.0% of traces
- _______________ ChatbotFacebookCallbackTestCase.test_valid_code ________________
- self = <tests.test_chatbot.ChatbotFacebookCallbackTestCase testMethod=test_valid_code>
- mock_authorized_response = <MagicMock name='authorized_response' id='140269009375808'>
- mock_get = <MagicMock name='get' id='140269009727272'>
- @patch("auth.oauth.providers.facebook.get")
- @patch("auth.oauth.providers.facebook.authorized_response")
- def test_valid_code(self, mock_authorized_response, mock_get):
- # token returned from google api
- mock_authorized_response.return_value = {
- "access_token": (
- "EAAOn6HZCqOwEBAN5W8ngQ7iZB7TyF9WvHT6GLjfeN7Bo8J92JZBG"
- "jFrFskU4UZApmP6EGhnbCZBJnBoI8kHcMR9tjoMATs4isbxcbgg2a"
- "3eu62vZBJyPDrsFKeCB6s4LA1aShnLjSazR8w3EkuST02QVP5tvbw"
- "CvAZD"
- ),
- "expires": "5102404",
- }
- # user info returner from google api
- class UserInfo(object):
- data = {"last_name": "Pelikan", "email": "juraj.pelikan@gmail.com", "first_name": "Juraj"}
- mock_get.return_value = UserInfo()
- url = (
- "/v1/chatbot.facebook.authorized?code=AQA_gYQhqs45SvcCexSvPN"
- "Lced0GQvPYf-lc0X0JCwdDlcgabynOsh78j-iJrS0canjF3q8dN4O81ir"
- "F5OLPagd8mAORKAu_qqcH57Ixz8Gl5BzAWkdLo0wh4cuBRSCtSCWNVCF2"
- "oUC2EDjWgjGsnDyzjBMDCkhn7hbJrbVEkGw4dtpyrAs8vv6a5m6XvJjgV"
- "WgnclfrDTh5s-iMNW3B0QOYpJL6ihpG0MpkemdeMWj3KafJWOGvZk65I9"
- "4Hfeh8vQw_teI2M-_J1HlqXZ0sE6ak_oLx-iiMp-dn2tpUYB5M6Zv-QGy"
- "eA1jKaD-4ht2H30&state={}"
- ).format("YXBwX2lkOjpodHRwOi8vd3d3Lmtpd2kuY29tOjpodHRwczovL2dyYXBoLmZhY2Vib29rLmNvbTo6bGlua190b2tlbg%3D%3D")
- response = self.client.get(url)
- > self.assertEqual(response.status_code, 302)
- E AssertionError: 500 != 302
- tests/test_chatbot.py:217: AssertionError
- ----------------------------- Captured stdout call -----------------------------
- 2019-03-14T17:03:52.114946Z [info ] request client_addr=127.0.0.1 forwarding= method=GET path=/v1/chatbot.facebook.authorized request_id=7826ffb809d444089221c42893f91b36
- 2019-03-14T17:03:52.120821Z [info ] oauth.redirect_url is_invalid=False request_id=7826ffb809d444089221c42893f91b36 url=http://www.kiwi.com
- 2019-03-14T17:03:52.121700Z [info ] parse_facebook_data.start data={"email": "juraj.pelikan@gmail.com", "first_name": "Juraj", "last_name": "Pelikan"} request_id=7826ffb809d444089221c42893f91b36
- 2019-03-14T17:03:52.122134Z [info ] parse_facebook_data.finish data={"email": "juraj.pelikan@gmail.com", "email_verified": true, "first_name": "Juraj", "last_name": "Pelikan"} request_id=7826ffb809d444089221c42893f91b36
- 2019-03-14T17:03:52.206025Z [info ] response length=56 request_id=7826ffb809d444089221c42893f91b36 status=500
- ----------------------------- Captured stderr call -----------------------------
- 2019-03-14T17:03:50.773631Z [info ] stdlib_log [flask.app] message=initializing trace middleware request_id=beed0f9345b247008c2848673d0eca52
- 2019-03-14T17:03:50.781036Z [debug ] stdlib_log [ddtrace.encoding] message=using Msgpack encoder request_id=beed0f9345b247008c2848673d0eca52
- 2019-03-14T17:03:50.781601Z [info ] stdlib_log [ddtrace.sampler] message=initialized RateSampler, sample 100.0% of traces request_id=beed0f9345b247008c2848673d0eca52
- 2019-03-14T17:03:50.788822Z [error ] stdlib_log [ddtrace.writer] message=cannot send spans to localhost:8126: [Errno 99] Address not available
- 2019-03-14T17:03:50.790798Z [debug ] stdlib_log [ddtrace.writer] message=resetting queues. pids(old:None new:68) request_id=beed0f9345b247008c2848673d0eca52
- 2019-03-14T17:03:50.791232Z [debug ] stdlib_log [ddtrace.writer] message=starting flush thread request_id=beed0f9345b247008c2848673d0eca52
- 2019-03-14T17:03:50.791903Z [error ] stdlib_log [ddtrace.writer] message=cannot send services to localhost:8126: [Errno 99] Address not available
- 2019-03-14T17:03:51.801344Z [error ] stdlib_log [ddtrace.writer] message=cannot send spans to localhost:8126: [Errno 99] Address not available
- 2019-03-14T17:03:51.807309Z [error ] stdlib_log [ddtrace.writer] message=cannot send services to localhost:8126: [Errno 99] Address not available
- ------------------------------ Captured log call -------------------------------
- middleware.py 31 INFO initializing trace middleware
- encoding.py 77 DEBUG using Msgpack encoder
- sampler.py 41 INFO initialized RateSampler, sample 100.0% of traces
- ____________________ GoogleCallbackTestCase.test_valid_code ____________________
- self = <tests.test_oauth.GoogleCallbackTestCase testMethod=test_valid_code>
- mock_authorized_response = <MagicMock name='authorized_response' id='140269008716744'>
- mock_get = <MagicMock name='get' id='140269009084880'>
- @patch("auth.oauth.providers.google.get")
- @patch("auth.oauth.providers.google.authorized_response")
- def test_valid_code(self, mock_authorized_response, mock_get):
- # token returned from google api
- mock_authorized_response.return_value = {
- "expires_in": 3600,
- "id_token": ("eyJhbGciOiJSUzI1NiIsImtpZCI6IjRiMTRiZWFkODZmZjBhZDRlZTAxZWFkYWUwNzBk" "YjM3YWE2YzY2Y2QifQ."),
- "token_type": "Bearer",
- "access_token": ("ya29.Ci9IA92ZqnIAgf3BUqMPkIW8X4NDB9JCu12ZsV5h902nGig5xj5Ix8WVzjy1ht3s2Q"),
- }
- # user info returner from google api
- class UserInfo(object):
- data = {
- "locale": "en",
- "family_name": "Koci",
- "given_name": "Pavel",
- "name": "Pavel Koci",
- "id": "10974864908507278145",
- "email": "pavel.koci@vacuumapps.com",
- "verified_email": True,
- "picture": "https://lh3.googleusercontent.com/-rscbv5M/photo.jpg",
- "hd": "vacuumapps.com",
- }
- mock_get.return_value = UserInfo()
- url = "/v1/oauth.google.authorized?state={}&" "code=4%2FVq84MGCyFcHuS-1tj7gpm9hbd81NhhW6eAfMN6TSb2o".format(
- self.state
- )
- response = self.client.get(url)
- > self.assertEqual(response.status_code, 302)
- E AssertionError: 500 != 302
- tests/test_oauth.py:106: AssertionError
- ----------------------------- Captured stdout call -----------------------------
- 2019-03-14T17:04:03.979448Z [info ] request client_addr=127.0.0.1 forwarding= method=GET path=/v1/oauth.google.authorized request_id=dda926280aae4773ae660449fb1f70b3
- 2019-03-14T17:04:03.985821Z [info ] oauth.redirect_url is_invalid=False request_id=dda926280aae4773ae660449fb1f70b3 url=http://localhost/next_uri
- 2019-03-14T17:04:03.986798Z [info ] parse_google_data.start data={"email": "pavel.koci@vacuumapps.com", "family_name": "Koci", "given_name": "Pavel", "hd": "vacuumapps.com", "id": "10974864908507278145", "locale": "en", "name": "Pavel Koci", "picture": "https://lh3.googleusercontent.com/-rscbv5M/photo.jpg", "verified_email": true} request_id=dda926280aae4773ae660449fb1f70b3
- 2019-03-14T17:04:03.987473Z [info ] parse_google_data.finish data={"email": "pavel.koci@vacuumapps.com", "email_verified": true, "first_name": "Pavel", "last_name": "Koci"} request_id=dda926280aae4773ae660449fb1f70b3
- 2019-03-14T17:04:04.080198Z [info ] response length=56 request_id=dda926280aae4773ae660449fb1f70b3 status=500
- ----------------------------- Captured stderr call -----------------------------
- 2019-03-14T17:04:02.530042Z [info ] stdlib_log [flask.app] message=initializing trace middleware request_id=5ab31580449a45ff8cf660f6202d946d
- 2019-03-14T17:04:02.545173Z [debug ] stdlib_log [ddtrace.encoding] message=using Msgpack encoder request_id=5ab31580449a45ff8cf660f6202d946d
- 2019-03-14T17:04:02.546549Z [info ] stdlib_log [ddtrace.sampler] message=initialized RateSampler, sample 100.0% of traces request_id=5ab31580449a45ff8cf660f6202d946d
- 2019-03-14T17:04:02.555752Z [debug ] stdlib_log [ddtrace.writer] message=resetting queues. pids(old:None new:68) request_id=5ab31580449a45ff8cf660f6202d946d
- 2019-03-14T17:04:02.556229Z [debug ] stdlib_log [ddtrace.writer] message=starting flush thread request_id=5ab31580449a45ff8cf660f6202d946d
- 2019-03-14T17:04:03.037516Z [error ] stdlib_log [ddtrace.writer] message=cannot send spans to localhost:8126: [Errno 99] Address not available
- 2019-03-14T17:04:03.042765Z [error ] stdlib_log [ddtrace.writer] message=cannot send services to localhost:8126: [Errno 99] Address not available
- 2019-03-14T17:04:03.560271Z [error ] stdlib_log [ddtrace.writer] message=cannot send spans to localhost:8126: [Errno 99] Address not available
- 2019-03-14T17:04:03.562922Z [error ] stdlib_log [ddtrace.writer] message=cannot send services to localhost:8126: [Errno 99] Address not available
- 2019-03-14T17:04:04.569119Z [error ] stdlib_log [ddtrace.writer] message=cannot send spans to localhost:8126: [Errno 99] Address not available
- 2019-03-14T17:04:04.573362Z [error ] stdlib_log [ddtrace.writer] message=cannot send services to localhost:8126: [Errno 99] Address not available
- ------------------------------ Captured log call -------------------------------
- middleware.py 31 INFO initializing trace middleware
- encoding.py 77 DEBUG using Msgpack encoder
- sampler.py 41 INFO initialized RateSampler, sample 100.0% of traces
- ___________________ FacebookCallbackTestCase.test_valid_code ___________________
- self = <tests.test_oauth.FacebookCallbackTestCase testMethod=test_valid_code>
- mock_authorized_response = <MagicMock name='authorized_response' id='140269008198288'>
- mock_get = <MagicMock name='get' id='140269007705872'>
- @patch("auth.oauth.providers.facebook.get")
- @patch("auth.oauth.providers.facebook.authorized_response")
- def test_valid_code(self, mock_authorized_response, mock_get):
- # token returned from google api
- mock_authorized_response.return_value = {
- "access_token": (
- "EAAOn6HZCqOwEBAN5W8ngQ7iZB7TyF9WvHT6GLjfeN7Bo8J92JZBG"
- "jFrFskU4UZApmP6EGhnbCZBJnBoI8kHcMR9tjoMATs4isbxcbgg2a"
- "3eu62vZBJyPDrsFKeCB6s4LA1aShnLjSazR8w3EkuST02QVP5tvbw"
- "CvAZD"
- ),
- "expires": "5102404",
- }
- # user info returner from google api
- class UserInfo(object):
- data = {"last_name": "Pelikan", "email": "juraj.pelikan@gmail.com", "first_name": "Juraj"}
- mock_get.return_value = UserInfo()
- url = (
- "/v1/oauth.facebook.authorized?code=AQA_gYQhqs45SvcCexSvPN"
- "Lced0GQvPYf-lc0X0JCwdDlcgabynOsh78j-iJrS0canjF3q8dN4O81ir"
- "F5OLPagd8mAORKAu_qqcH57Ixz8Gl5BzAWkdLo0wh4cuBRSCtSCWNVCF2"
- "oUC2EDjWgjGsnDyzjBMDCkhn7hbJrbVEkGw4dtpyrAs8vv6a5m6XvJjgV"
- "WgnclfrDTh5s-iMNW3B0QOYpJL6ihpG0MpkemdeMWj3KafJWOGvZk65I9"
- "4Hfeh8vQw_teI2M-_J1HlqXZ0sE6ak_oLx-iiMp-dn2tpUYB5M6Zv-QGy"
- "eA1jKaD-4ht2H30&state={}"
- ).format(self.state)
- response = self.client.get(url)
- > self.assertEqual(response.status_code, 302)
- E AssertionError: 500 != 302
- tests/test_oauth.py:204: AssertionError
- ----------------------------- Captured stdout call -----------------------------
- 2019-03-14T17:04:10.520890Z [info ] request client_addr=127.0.0.1 forwarding= method=GET path=/v1/oauth.facebook.authorized request_id=263004189d5b4a0cbb7dfb30964b8a19
- 2019-03-14T17:04:10.526580Z [info ] oauth.redirect_url is_invalid=False request_id=263004189d5b4a0cbb7dfb30964b8a19 url=http://localhost/next_uri
- 2019-03-14T17:04:10.527198Z [info ] parse_facebook_data.start data={"email": "juraj.pelikan@gmail.com", "first_name": "Juraj", "last_name": "Pelikan"} request_id=263004189d5b4a0cbb7dfb30964b8a19
- 2019-03-14T17:04:10.527624Z [info ] parse_facebook_data.finish data={"email": "juraj.pelikan@gmail.com", "email_verified": true, "first_name": "Juraj", "last_name": "Pelikan"} request_id=263004189d5b4a0cbb7dfb30964b8a19
- 2019-03-14T17:04:10.613207Z [info ] response length=56 request_id=263004189d5b4a0cbb7dfb30964b8a19 status=500
- ----------------------------- Captured stderr call -----------------------------
- 2019-03-14T17:04:09.193606Z [info ] stdlib_log [flask.app] message=initializing trace middleware request_id=decabbaa67cc47c5872fa29c1384b6b2
- 2019-03-14T17:04:09.201902Z [debug ] stdlib_log [ddtrace.encoding] message=using Msgpack encoder request_id=decabbaa67cc47c5872fa29c1384b6b2
- 2019-03-14T17:04:09.202386Z [info ] stdlib_log [ddtrace.sampler] message=initialized RateSampler, sample 100.0% of traces request_id=decabbaa67cc47c5872fa29c1384b6b2
- 2019-03-14T17:04:09.209675Z [debug ] stdlib_log [ddtrace.writer] message=resetting queues. pids(old:None new:68) request_id=decabbaa67cc47c5872fa29c1384b6b2
- 2019-03-14T17:04:09.210112Z [debug ] stdlib_log [ddtrace.writer] message=starting flush thread request_id=decabbaa67cc47c5872fa29c1384b6b2
- 2019-03-14T17:04:09.713634Z [error ] stdlib_log [ddtrace.writer] message=cannot send spans to localhost:8126: [Errno 99] Address not available
- 2019-03-14T17:04:09.717894Z [error ] stdlib_log [ddtrace.writer] message=cannot send services to localhost:8126: [Errno 99] Address not available
- 2019-03-14T17:04:10.215471Z [error ] stdlib_log [ddtrace.writer] message=cannot send spans to localhost:8126: [Errno 99] Address not available
- 2019-03-14T17:04:10.218956Z [error ] stdlib_log [ddtrace.writer] message=cannot send services to localhost:8126: [Errno 99] Address not available
- ------------------------------ Captured log call -------------------------------
- middleware.py 31 INFO initializing trace middleware
- encoding.py 77 DEBUG using Msgpack encoder
- sampler.py 41 INFO initialized RateSampler, sample 100.0% of traces
- ______________ FacebookMobileConnectTestCase.test_mobile_connect _______________
- self = <tests.test_oauth.FacebookMobileConnectTestCase testMethod=test_mobile_connect>
- mock_get = <MagicMock name='get' id='140269007506624'>
- mock_verifier = <MagicMock name='verify_access_token' id='140269007520152'>
- @patch("auth.oauth.views.verify_access_token")
- @patch("auth.oauth.providers.facebook.get")
- def test_mobile_connect(self, mock_get, mock_verifier):
- self.assertEqual(User.query.count(), 0)
- class UserInfo(object):
- data = {"last_name": "Pelikan", "email": "juraj.pelikan@gmail.com", "first_name": "Juraj"}
- mock_get.return_value = UserInfo()
- oauth_payload = {
- "access_token": (
- "EAAOn6HZCqOwEBAN5W8ngQ7iZB7TyF9WvHT6GLjfeN7Bo8J92JZBG"
- "jFrFskU4UZApmP6EGhnbCZBJnBoI8kHcMR9tjoMATs4isbxcbgg2a"
- "3eu62vZBJyPDrsFKeCB6s4LA1aShnLjSazR8w3EkuST02QVP5tvbw"
- "CvAZD"
- ),
- "expires": "5102404",
- }
- headers = {"Authorization": "Basic " + b64encode(b"app_id:").decode("utf8")}
- resp = self.client.post(
- "/v1/oauth.facebook.connect",
- data=json.dumps(oauth_payload),
- content_type="application/json",
- headers=headers,
- )
- > self.assertIn("token", json.loads(resp.data))
- E AssertionError: 'token' not found in {'error_code': 'SQL_FAILED', 'message': 'Database error.'}
- tests/test_oauth.py:246: AssertionError
- ----------------------------- Captured stdout call -----------------------------
- 2019-03-14T17:04:14.669478Z [info ] request client_addr=127.0.0.1 forwarding= json={'access_token': 'EAAOn6HZCqOwEBAN5W8ngQ7iZB7TyF9WvHT6GLjfeN7Bo8J92JZBGjFrFskU4UZApmP6EGhnbCZBJnBoI8kHcMR9tjoMATs4isbxcbgg2a3eu62vZBJyPDrsFKeCB6s4LA1aShnLjSazR8w3EkuST02QVP5tvbwCvAZD', 'expires': '5102404'} method=POST path=/v1/oauth.facebook.connect request_id=233e9d0a7aaf41908ee47a3ef634c6ed
- 2019-03-14T17:04:14.679314Z [info ] parse_facebook_data.start data={"email": "juraj.pelikan@gmail.com", "first_name": "Juraj", "last_name": "Pelikan"} request_id=233e9d0a7aaf41908ee47a3ef634c6ed
- 2019-03-14T17:04:14.679680Z [info ] parse_facebook_data.finish data={"email": "juraj.pelikan@gmail.com", "email_verified": true, "first_name": "Juraj", "last_name": "Pelikan"} request_id=233e9d0a7aaf41908ee47a3ef634c6ed
- 2019-03-14T17:04:14.771341Z [info ] response length=56 request_id=233e9d0a7aaf41908ee47a3ef634c6ed status=500
- ----------------------------- Captured stderr call -----------------------------
- 2019-03-14T17:04:13.275735Z [info ] stdlib_log [flask.app] message=initializing trace middleware request_id=49753ee9620a487bbb989e481f998fb5
- 2019-03-14T17:04:13.287691Z [debug ] stdlib_log [ddtrace.encoding] message=using Msgpack encoder request_id=49753ee9620a487bbb989e481f998fb5
- 2019-03-14T17:04:13.288742Z [info ] stdlib_log [ddtrace.sampler] message=initialized RateSampler, sample 100.0% of traces request_id=49753ee9620a487bbb989e481f998fb5
- 2019-03-14T17:04:13.298281Z [error ] stdlib_log [ddtrace.writer] message=cannot send spans to localhost:8126: [Errno 99] Address not available
- 2019-03-14T17:04:13.300164Z [error ] stdlib_log [ddtrace.writer] message=cannot send services to localhost:8126: [Errno 99] Address not available
- 2019-03-14T17:04:13.300773Z [debug ] stdlib_log [ddtrace.writer] message=resetting queues. pids(old:None new:68) request_id=49753ee9620a487bbb989e481f998fb5
- 2019-03-14T17:04:13.301179Z [debug ] stdlib_log [ddtrace.writer] message=starting flush thread request_id=49753ee9620a487bbb989e481f998fb5
- 2019-03-14T17:04:14.306060Z [error ] stdlib_log [ddtrace.writer] message=cannot send spans to localhost:8126: [Errno 99] Address not available
- 2019-03-14T17:04:14.308691Z [error ] stdlib_log [ddtrace.writer] message=cannot send services to localhost:8126: [Errno 99] Address not available
- ------------------------------ Captured log call -------------------------------
- middleware.py 31 INFO initializing trace middleware
- encoding.py 77 DEBUG using Msgpack encoder
- sampler.py 41 INFO initialized RateSampler, sample 100.0% of traces
- ________________ GoogleMobileConectTestCase.test_mobile_connect ________________
- self = <tests.test_oauth.GoogleMobileConectTestCase testMethod=test_mobile_connect>
- mock_get = <MagicMock name='get' id='140269007031992'>
- mock_verifier = <MagicMock name='verify_access_token' id='140269008206088'>
- @patch("auth.oauth.views.verify_access_token")
- @patch("auth.oauth.providers.google.get")
- def test_mobile_connect(self, mock_get, mock_verifier):
- self.assertEqual(User.query.count(), 0)
- class UserInfo(object):
- data = {
- "locale": "en",
- "family_name": "Koci",
- "given_name": "Pavel",
- "name": "Pavel Koci",
- "id": "10974864908507278145",
- "email": "pavel.koci@vacuumapps.com",
- "verified_email": True,
- "picture": "https://lh3.googleusercontent.com/-rscbv5M/photo.jpg",
- "hd": "vacuumapps.com",
- }
- mock_get.return_value = UserInfo()
- oauth_payload = {
- "access_token": (
- "EAAOn6HZCqOwEBAN5W8ngQ7iZB7TyF9WvHT6GLjfeN7Bo8J92JZBG"
- "jFrFskU4UZApmP6EGhnbCZBJnBoI8kHcMR9tjoMATs4isbxcbgg2a"
- "3eu62vZBJyPDrsFKeCB6s4LA1aShnLjSazR8w3EkuST02QVP5tvbw"
- "CvAZD"
- ),
- "expires": "5102404",
- }
- headers = {"Authorization": "Basic " + b64encode(b"app_id:").decode("utf8")}
- resp = self.client.post(
- "/v1/oauth.google.connect", data=json.dumps(oauth_payload), content_type="application/json", headers=headers
- )
- > self.assertIn("token", json.loads(resp.data))
- E AssertionError: 'token' not found in {'error_code': 'SQL_FAILED', 'message': 'Database error.'}
- tests/test_oauth.py:298: AssertionError
- ----------------------------- Captured stdout call -----------------------------
- 2019-03-14T17:04:17.075935Z [info ] request client_addr=127.0.0.1 forwarding= json={'access_token': 'EAAOn6HZCqOwEBAN5W8ngQ7iZB7TyF9WvHT6GLjfeN7Bo8J92JZBGjFrFskU4UZApmP6EGhnbCZBJnBoI8kHcMR9tjoMATs4isbxcbgg2a3eu62vZBJyPDrsFKeCB6s4LA1aShnLjSazR8w3EkuST02QVP5tvbwCvAZD', 'expires': '5102404'} method=POST path=/v1/oauth.google.connect request_id=9617537da6c3438fa47d1e1d2305a2a8
- 2019-03-14T17:04:17.080314Z [info ] parse_google_data.start data={"email": "pavel.koci@vacuumapps.com", "family_name": "Koci", "given_name": "Pavel", "hd": "vacuumapps.com", "id": "10974864908507278145", "locale": "en", "name": "Pavel Koci", "picture": "https://lh3.googleusercontent.com/-rscbv5M/photo.jpg", "verified_email": true} request_id=9617537da6c3438fa47d1e1d2305a2a8
- 2019-03-14T17:04:17.080663Z [info ] parse_google_data.finish data={"email": "pavel.koci@vacuumapps.com", "email_verified": true, "first_name": "Pavel", "last_name": "Koci"} request_id=9617537da6c3438fa47d1e1d2305a2a8
- 2019-03-14T17:04:17.151207Z [info ] response length=56 request_id=9617537da6c3438fa47d1e1d2305a2a8 status=500
- ----------------------------- Captured stderr call -----------------------------
- 2019-03-14T17:04:15.341516Z [info ] stdlib_log [flask.app] message=initializing trace middleware request_id=233e9d0a7aaf41908ee47a3ef634c6ed
- 2019-03-14T17:04:15.346497Z [debug ] stdlib_log [ddtrace.encoding] message=using Msgpack encoder request_id=233e9d0a7aaf41908ee47a3ef634c6ed
- 2019-03-14T17:04:15.346984Z [info ] stdlib_log [ddtrace.sampler] message=initialized RateSampler, sample 100.0% of traces request_id=233e9d0a7aaf41908ee47a3ef634c6ed
- 2019-03-14T17:04:15.353702Z [error ] stdlib_log [ddtrace.writer] message=cannot send spans to localhost:8126: [Errno 99] Address not available
- 2019-03-14T17:04:15.355667Z [debug ] stdlib_log [ddtrace.writer] message=resetting queues. pids(old:None new:68) request_id=233e9d0a7aaf41908ee47a3ef634c6ed
- 2019-03-14T17:04:15.356131Z [debug ] stdlib_log [ddtrace.writer] message=starting flush thread request_id=233e9d0a7aaf41908ee47a3ef634c6ed
- 2019-03-14T17:04:15.356762Z [error ] stdlib_log [ddtrace.writer] message=cannot send services to localhost:8126: [Errno 99] Address not available
- 2019-03-14T17:04:16.363432Z [error ] stdlib_log [ddtrace.writer] message=cannot send spans to localhost:8126: [Errno 99] Address not available
- 2019-03-14T17:04:16.368514Z [error ] stdlib_log [ddtrace.writer] message=cannot send services to localhost:8126: [Errno 99] Address not available
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement