How to use the ox3apiclient.Client 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 _get_client(self, get_return=None, put_return=None, post_return=None, options_return=None, delete_return=None):
        ex_resp = self._build_mock_response()

        with patch('ox3apiclient.requests.Session') as mock_requests_session:
            with patch('ox3apiclient.Client.log_request') as mock_client_log_request:
                mock_requests_session.return_value.get.return_value = get_return or ex_resp
                mock_requests_session.return_value.post.return_value = post_return or ex_resp
                mock_requests_session.return_value.put.return_value = put_return or ex_resp
                mock_requests_session.return_value.options.return_value = options_return or ex_resp
                mock_requests_session.return_value.delete.return_value = delete_return or ex_resp

                mock_client_log_request.return_value = None
                return ox3apiclient.Client(
                    email=self.email,
                    password=self.password,
                    domain=self.domain,
                    realm=self.realm,
                    consumer_key=self.consumer_key,
                    consumer_secret=self.consumer_secret,
                    request_token_url=self.request_token_url,
                    access_token_url=self.access_token_url,
                    authorization_url=self.authorization_url)
github openx / OX3-Python-API-Client / tests / clientfromfile.py View on Github external
def test_returns_client(self):
        file_path = os.path.join(os.path.dirname(__file__), 'ox3rctest')
        ox = ox3apiclient.client_from_file(file_path=file_path)
        self.assertTrue(isinstance(ox, ox3apiclient.Client))
github openx / OX3-Python-API-Client / test / test_client.py View on Github external
def test_logoff(self):
        client = self._get_client()
        ret_val = client.logoff()
        self.assertTrue(isinstance(ret_val, ox3apiclient.Client))

ox3apiclient

Client to connect to the OpenX Enterprise API.

BSD-2-Clause
Latest version published 3 years ago

Package Health Score

42 / 100
Full package analysis