Comments (2)
========================================================================================= FAILURES ==========================================================================================
_____________________________________________________________________________________ test_custom_token _____________________________________________________________________________________
api_key = 'AIzaSyC2oKOCYaYhczl3axh4U5lZeIyt6-2Ii1Q'
def test_custom_token(api_key):
custom_token = auth.create_custom_token('user1')
> id_token = _sign_in(custom_token, api_key)
integration/test_auth.py:33:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
integration/test_auth.py:27: in _sign_in
resp = requests.request('post', _id_toolkit_url, params=params, json=body)
../../../.pyenv/versions/3.5.0/lib/python3.5/site-packages/requests/api.py:58: in request
return session.request(method=method, url=url, **kwargs)
../../../.pyenv/versions/3.5.0/lib/python3.5/site-packages/requests/sessions.py:488: in request
prep = self.prepare_request(req)
../../../.pyenv/versions/3.5.0/lib/python3.5/site-packages/requests/sessions.py:431: in prepare_request
hooks=merge_hooks(request.hooks, self.hooks),
../../../.pyenv/versions/3.5.0/lib/python3.5/site-packages/requests/models.py:308: in prepare
self.prepare_body(data, files, json)
../../../.pyenv/versions/3.5.0/lib/python3.5/site-packages/requests/models.py:458: in prepare_body
body = complexjson.dumps(json)
../../../.pyenv/versions/3.5.0/lib/python3.5/json/__init__.py:230: in dumps
return _default_encoder.encode(obj)
../../../.pyenv/versions/3.5.0/lib/python3.5/json/encoder.py:199: in encode
chunks = self.iterencode(o, _one_shot=True)
../../../.pyenv/versions/3.5.0/lib/python3.5/json/encoder.py:257: in iterencode
return _iterencode(o, 0)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <json.encoder.JSONEncoder object at 0x7fdf91a52470>
o = b'eyJhbGciOiAiUlMyNTYiLCAia2lkIjogIjhkMTRkNjZiZGJiODdjYzk3Y2YzOTlmZDUwOWYyNWZlNTk2N2MwZTkiLCAidHlwIjogIkpXVCJ9.eyJleHA...tQsYqx8_ZTlZDUC7nHfp4DBOaSmR7VL7JNXyN6kPNG2x43FYIlAlnunhwDCFSkNyhgo2_q9toJafB4WjnMinonllQ8qI3-f8AX7EXRrYxdsiet1RwAtw=='
def default(self, o):
"""Implement this method in a subclass such that it returns
a serializable object for ``o``, or calls the base implementation
(to raise a ``TypeError``).
For example, to support arbitrary iterators, you could
implement default like this::
def default(self, o):
try:
iterable = iter(o)
except TypeError:
pass
else:
return list(iterable)
# Let the base class default method raise the TypeError
return JSONEncoder.default(self, o)
"""
> raise TypeError(repr(o) + " is not JSON serializable")
E TypeError: b'eyJhbGciOiAiUlMyNTYiLCAia2lkIjogIjhkMTRkNjZiZGJiODdjYzk3Y2YzOTlmZDUwOWYyNWZlNTk2N2MwZTkiLCAidHlwIjogIkpXVCJ9.eyJleHAiOiAxNDk5NDcxNTI2LCAidWlkIjogInVzZXIxIiwgImlzcyI6ICJmaXJlYmFzZS1hZG1pbnNkay1qa2I0Y0BhZG1pbi1qYXZhLWludGVncmF0aW9uLmlhbS5nc2VydmljZWFjY291bnQuY29tIiwgInN1YiI6ICJmaXJlYmFzZS1hZG1pbnNkay1qa2I0Y0BhZG1pbi1qYXZhLWludGVncmF0aW9uLmlhbS5nc2VydmljZWFjY291bnQuY29tIiwgImlhdCI6IDE0OTk0Njc5MjYsICJhdWQiOiAiaHR0cHM6Ly9pZGVudGl0eXRvb2xraXQuZ29vZ2xlYXBpcy5jb20vZ29vZ2xlLmlkZW50aXR5LmlkZW50aXR5dG9vbGtpdC52MS5JZGVudGl0eVRvb2xraXQifQ==.r1LTrprH1xnPXdou8rQhqNI64PvbU2dtV2sgl3WBuBIvwGp6lrMj6-7nRSBceJaZ91dWY2EkpQqFRITXi9Ii0OFPKk2ljkUTAV2PTvMwncAcdp4akIyZLIsMeygxD2uqk-jVvT2iCLVBtXYl-y9d3M6zpLCIpfgfRgIu_gX_OJr7EEqUUXueS6IzeHvovMJv-Ca5owyuLUns4aWbxLzF09Q8htFiE2WAIptQsYqx8_ZTlZDUC7nHfp4DBOaSmR7VL7JNXyN6kPNG2x43FYIlAlnunhwDCFSkNyhgo2_q9toJafB4WjnMinonllQ8qI3-f8AX7EXRrYxdsiet1RwAtw==' is not JSON serializable
../../../.pyenv/versions/3.5.0/lib/python3.5/json/encoder.py:180: TypeError
_______________________________________________________________________________ test_custom_token_with_claims _______________________________________________________________________________
api_key = 'AIzaSyC2oKOCYaYhczl3axh4U5lZeIyt6-2Ii1Q'
def test_custom_token_with_claims(api_key):
dev_claims = {'premium' : True, 'subscription' : 'silver'}
custom_token = auth.create_custom_token('user2', dev_claims)
> id_token = _sign_in(custom_token, api_key)
integration/test_auth.py:40:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
integration/test_auth.py:27: in _sign_in
resp = requests.request('post', _id_toolkit_url, params=params, json=body)
../../../.pyenv/versions/3.5.0/lib/python3.5/site-packages/requests/api.py:58: in request
return session.request(method=method, url=url, **kwargs)
../../../.pyenv/versions/3.5.0/lib/python3.5/site-packages/requests/sessions.py:488: in request
prep = self.prepare_request(req)
../../../.pyenv/versions/3.5.0/lib/python3.5/site-packages/requests/sessions.py:431: in prepare_request
hooks=merge_hooks(request.hooks, self.hooks),
../../../.pyenv/versions/3.5.0/lib/python3.5/site-packages/requests/models.py:308: in prepare
self.prepare_body(data, files, json)
../../../.pyenv/versions/3.5.0/lib/python3.5/site-packages/requests/models.py:458: in prepare_body
body = complexjson.dumps(json)
../../../.pyenv/versions/3.5.0/lib/python3.5/json/__init__.py:230: in dumps
return _default_encoder.encode(obj)
../../../.pyenv/versions/3.5.0/lib/python3.5/json/encoder.py:199: in encode
chunks = self.iterencode(o, _one_shot=True)
../../../.pyenv/versions/3.5.0/lib/python3.5/json/encoder.py:257: in iterencode
return _iterencode(o, 0)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <json.encoder.JSONEncoder object at 0x7fdf91a52470>
o = b'eyJhbGciOiAiUlMyNTYiLCAia2lkIjogIjhkMTRkNjZiZGJiODdjYzk3Y2YzOTlmZDUwOWYyNWZlNTk2N2MwZTkiLCAidHlwIjogIkpXVCJ9.eyJleHA...cnGyEzT1IPAy6L9npuomrOiryZhil1L5Skmmkj6KyNoHdwngU3HlwE-qxqoR4yCd3s8C_Jbkq25LN353Cfeovsyj_mwMvOsmvSN4vCuWspl8EAUPs2Xw=='
def default(self, o):
"""Implement this method in a subclass such that it returns
a serializable object for ``o``, or calls the base implementation
(to raise a ``TypeError``).
For example, to support arbitrary iterators, you could
implement default like this::
def default(self, o):
try:
iterable = iter(o)
except TypeError:
pass
else:
return list(iterable)
# Let the base class default method raise the TypeError
return JSONEncoder.default(self, o)
"""
> raise TypeError(repr(o) + " is not JSON serializable")
E TypeError: b'eyJhbGciOiAiUlMyNTYiLCAia2lkIjogIjhkMTRkNjZiZGJiODdjYzk3Y2YzOTlmZDUwOWYyNWZlNTk2N2MwZTkiLCAidHlwIjogIkpXVCJ9.eyJleHAiOiAxNDk5NDcxNTI2LCAidWlkIjogInVzZXIyIiwgImlzcyI6ICJmaXJlYmFzZS1hZG1pbnNkay1qa2I0Y0BhZG1pbi1qYXZhLWludGVncmF0aW9uLmlhbS5nc2VydmljZWFjY291bnQuY29tIiwgInN1YiI6ICJmaXJlYmFzZS1hZG1pbnNkay1qa2I0Y0BhZG1pbi1qYXZhLWludGVncmF0aW9uLmlhbS5nc2VydmljZWFjY291bnQuY29tIiwgImNsYWltcyI6IHsic3Vic2NyaXB0aW9uIjogInNpbHZlciIsICJwcmVtaXVtIjogdHJ1ZX0sICJpYXQiOiAxNDk5NDY3OTI2LCAiYXVkIjogImh0dHBzOi8vaWRlbnRpdHl0b29sa2l0Lmdvb2dsZWFwaXMuY29tL2dvb2dsZS5pZGVudGl0eS5pZGVudGl0eXRvb2xraXQudjEuSWRlbnRpdHlUb29sa2l0In0=.jmsbXzeqmASDQE8aUNiwLqzygjURpIEXGRxl_0Dvz1sxzS3IxXTW_yyYHPZ7B3YgVw-gt0W9azwbXEKjOaqOP8jAlFJ-IuQqwR9yKqg5OWJyewDHzORFIvR5GtMlRJcZOoWS_nCaB0wymzKzexB6-tZunlhwo0-LIT3zfbi60FnlrtjSxNSU_xUP6lO5pjtgBpIchUqNeop5qPrAxrO-IsRo9HZZIuPSnxcnGyEzT1IPAy6L9npuomrOiryZhil1L5Skmmkj6KyNoHdwngU3HlwE-qxqoR4yCd3s8C_Jbkq25LN353Cfeovsyj_mwMvOsmvSN4vCuWspl8EAUPs2Xw==' is not JSON serializable
../../../.pyenv/versions/3.5.0/lib/python3.5/json/encoder.py:180: TypeError
=========================================================================== 2 failed, 34 passed in 12.65 seconds ============================================================================
from firebase-admin-python.
Fixed
from firebase-admin-python.
Related Issues (20)
- [FR] - When using Email/Password authentication, add a way to login with the password HOT 2
- Transaction contextmanager does not set transaction to in_progress HOT 2
- python-jwt is deprecated HOT 2
- firebase_admin installed and got PyJWKClient issue HOT 2
- [FR] Download url like with node js client HOT 1
- Github Desktop Pull/Push Issue HOT 2
- [FR] Adding global var HOT 1
- Option to pass values to the transaction function callback HOT 1
- auth.verify_id_token throwing ValueError HOT 1
- [FR] Add Support for Pyodide by providing a wheel with binaries built for Emscripten. HOT 2
- [FR] Add WebApps support to project_management HOT 1
- Couldn't import app_check HOT 1
- Firebase functions container silently freezes on making a get request to Firestore if multiple requests were created before container starts HOT 3
- Call to Firestore getting timed out from the docker container. HOT 1
- Querying Firestore documents by nested key-value in an array field using Python HOT 1
- firestore times out when using default DNS resolver HOT 1
- [FR] Async `messaging` requests HOT 1
- import firebase admin HOT 3
- Using cloud run from gcp console to firebase HOT 1
- Cloud run from gcp console HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from firebase-admin-python.