How to use the ox3apiclient.OAuthException function in ox3apiclient

To help you get started, we’ve selected a few ox3apiclient examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github openx / OX3-Python-API-Client / test / test_client.py View on Github external
def test_authorize_token(self):
        # mock the post response, and do some setup
        r = self._build_mock_response()
        r.text = 'oauth_verifier=verifier'
        r.return_value = {'key': 'key', 'secret': 'secret'}
        client = self._get_client(post_return=r)
        client._token = {'key': 'key', 'secret': 'secret'}

        # Unauthorized Case
        r.status_code = 401
        with self.assertRaises(ox3apiclient.OAuthException):
            client.authorize_token()

        # Authorized Case
        r.status_code = 200
        client.authorize_token()
        self.assertEqual(client._token['verifier'], 'verifier')

ox3apiclient

Client to connect to the OpenX Enterprise API.

BSD-2-Clause
Latest version published 3 years ago

Package Health Score

39 / 100
Full package analysis