def authorize(username, password): azion = Azion() return azion.authorize(username, password)
def test_authorize(self): mocked_session = create_mocked_session() client = Azion(session=mocked_session) client.authorize('foo', 'bar') mocked_session.post.assert_called_once_with( 'https://api.azion.net/tokens', data={}, auth=('foo', 'bar'))