Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
577d103
Started implementing the user management API
hiranya911 Jul 13, 2017
94aa617
Implementing more test cases
hiranya911 Jul 13, 2017
e9caf60
Fixing a python 3 test failure
hiranya911 Jul 13, 2017
826cab4
Combined the auth tests into one module
hiranya911 Jul 13, 2017
f86c0b4
Implemented the rest of the user management API
hiranya911 Jul 13, 2017
3be855a
Implemented more unit tests for user management API
hiranya911 Jul 13, 2017
def74cd
Updated API docs
hiranya911 Jul 13, 2017
ba3dca7
Implemented phone number auth support
hiranya911 Jul 13, 2017
37724ae
Stricter validation for arguments
hiranya911 Jul 13, 2017
15efd0a
Added more tests
hiranya911 Jul 13, 2017
8235199
Improved test coverage
hiranya911 Jul 13, 2017
c91d415
Updated user management tests
hiranya911 Jul 14, 2017
52ab376
Test cases for valid phone numbers
hiranya911 Jul 18, 2017
7242fef
Updated error message
hiranya911 Jul 21, 2017
06f3745
Updated create_user() and update_user() to accept kwargs instead of d…
hiranya911 Jul 26, 2017
e64bc09
Merge branch 'master' into hkj-user-mgt
hiranya911 Jul 26, 2017
24a4c06
Updated documentation
hiranya911 Jul 27, 2017
d2f76cf
Refactoring code by merging some redundant lines
hiranya911 Aug 1, 2017
6b1e1b4
Extract user managemnt code into a separate helper module
hiranya911 Aug 1, 2017
ad4d7b7
Using constants in test code
hiranya911 Aug 1, 2017
fcec67b
Fixing a typo
hiranya911 Aug 2, 2017
7aa00ef
Merging with master (resolved conflicts in test_db.py)
hiranya911 Aug 11, 2017
c0f8076
Merge branch 'hkj-user-mgt' of github.com:firebase/firebase-admin-pyt…
hiranya911 Aug 11, 2017
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Merging with master (resolved conflicts in test_db.py)
  • Loading branch information
hiranya911 committed Aug 11, 2017
commit 7aa00ef0e291caff97d4d06178dacdb1473afcc8
24 changes: 22 additions & 2 deletions tests/test_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,32 @@
import sys

import pytest
from requests import exceptions
from requests import Response

import firebase_admin
from firebase_admin import db
from tests import testutils


class MockAdapter(testutils.MockAdapter):
_ETAG = '0'

def __init__(self, data, status, recorder):
testutils.MockAdapter.__init__(self, data, status, recorder)

def send(self, request, **kwargs):
if_match = request.headers.get('if-match')
if if_match and if_match != MockAdapter._ETAG:
response = Response()
response._content = request.body
response.headers = {'ETag': MockAdapter._ETAG}
raise exceptions.RequestException(response=response)
resp = super(MockAdapter, self).send(request, **kwargs)
resp.headers = {'ETag': MockAdapter._ETAG}
return resp


class _Object(object):
pass

Expand Down Expand Up @@ -107,7 +127,7 @@ def teardown_class(cls):

def instrument(self, ref, payload, status=200):
recorder = []
adapter = testutils.MockAdapter(payload, status, recorder)
adapter = MockAdapter(payload, status, recorder)
ref._client._session.mount(self.test_url, adapter)
return recorder

Expand Down Expand Up @@ -349,7 +369,7 @@ def teardown_class(cls):

def instrument(self, ref, payload, status=200):
recorder = []
adapter = testutils.MockAdapter(payload, status, recorder)
adapter = MockAdapter(payload, status, recorder)
ref._client._session.mount(self.test_url, adapter)
return recorder

Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.