示例#1
0
    def test_check_api_response_without_okta_error(self):
        """Ensure that an invalid response without an OKTA error gets handled properly"""

        api_client = ApiClient()
        try:
            api_client.check_api_response({}, 400)
            raise AssertionError("check_api_response should have raised an exception and didn't.")
        except ApiException as err:
            self.assertIn('Okta returned 400', str(err))
    def test_check_api_response_without_okta_error(self):
        """Ensure that an invalid response without an OKTA error gets handled properly"""

        api_client = ApiClient()
        try:
            api_client.check_api_response({}, 400)
            raise AssertionError(
                "check_api_response should have raised an exception and didn't."
            )
        except ApiException as err:
            self.assertIn('Okta returned 400', str(err))
示例#3
0
    def test_check_api_response_no_causes(self):
        api_client = ApiClient()

        err_msg = {
            "errorSummary": "This is a short error message",
            "errorCauses": []
        }
        try:
            api_client.check_api_response(err_msg, 400)
            raise AssertionError("check_api_response should have raised an exception and didn't.")
        except ApiException as err:
            self.assertIn(err_msg['errorSummary'], str(err))
    def test_check_api_response_no_causes(self):
        api_client = ApiClient()

        err_msg = {
            "errorSummary": "This is a short error message",
            "errorCauses": []
        }
        try:
            api_client.check_api_response(err_msg, 400)
            raise AssertionError(
                "check_api_response should have raised an exception and didn't."
            )
        except ApiException as err:
            self.assertIn(err_msg['errorSummary'], str(err))