зеркало из https://github.com/mozilla/FlightDeck.git
logging send and sign request
This commit is contained in:
Родитель
c72ae588ca
Коммит
3cf6930c26
|
@ -66,19 +66,5 @@ class AuthTest(TestCase):
|
|||
"occupation": "addon developer"
|
||||
})))
|
||||
httplib2.Http = Mock(return_value=Http())
|
||||
#AMOOAuth._request = Mock(return_value=(
|
||||
# Response(),
|
||||
# json.dumps({
|
||||
# "username": "some",
|
||||
# "display_name": "Some User",
|
||||
# "created": "2007-03-05 13:09:38",
|
||||
# "modified": "2012-01-31 12:38:50",
|
||||
# "id": 12345,
|
||||
# "location": "Portland, OR",
|
||||
# "homepage": "http://example.com",
|
||||
# "email": "some@example.com",
|
||||
# "occupation": "addon developer"
|
||||
# }))
|
||||
# )
|
||||
eq_(fetch_amo_user('some@example.com')['username'],
|
||||
'some')
|
||||
|
|
|
@ -106,13 +106,14 @@ class AMOOAuth:
|
|||
content).groups()[0]
|
||||
|
||||
def _request(self, token, method, url, data={}, headers={}, **kw):
|
||||
log.debug('I am actually called')
|
||||
parameters = data_keys(data)
|
||||
parameters.update(kw)
|
||||
request = (oauth.Request
|
||||
.from_consumer_and_token(self.get_consumer(), token,
|
||||
method, url, parameters))
|
||||
log.debug('request created')
|
||||
request.sign_request(self.signature_method, self.get_consumer(), token)
|
||||
log.debug('request signed')
|
||||
client = httplib2.Http()
|
||||
if data and method == 'POST':
|
||||
data = encode_multipart(boundary, data)
|
||||
|
|
Загрузка…
Ссылка в новой задаче