コード例 #1
0
ファイル: tests.py プロジェクト: bensternthal/basket-client
 def test_debug_user(self):
     """
     debug_user passes the expected args to request(), returns the result.
     """
     email = "*****@*****.**"
     supertoken = "STOKEN"
     params = {'email': email, 'supertoken': supertoken}
     with patch('basket.base.request', autospec=True) as request_call:
         result = debug_user(email, supertoken)
     request_call.assert_called_with('get', 'debug-user', params=params)
     self.assertEqual(request_call.return_value, result)
コード例 #2
0
 def test_debug_user(self):
     """
     debug_user passes the expected args to request(), returns the result.
     """
     email = "*****@*****.**"
     supertoken = "STOKEN"
     params = {'email': email, 'supertoken': supertoken}
     with patch('basket.base.request', autospec=True) as request_call:
         result = debug_user(email, supertoken)
     request_call.assert_called_with('get', 'debug-user', params=params)
     self.assertEqual(request_call.return_value, result)
コード例 #3
0
def get_user(email):
    try:
        user_data = basket.debug_user(email, SUPERTOKEN)
    except basket.BasketException:
        user_data = None
    return user_data
コード例 #4
0
ファイル: get_tokens.py プロジェクト: pmclanahan/basket_tools
def get_user(email):
    try:
        return basket.debug_user(email, SUPERTOKEN)
    except basket.BasketException:
        return None