

def assertRaisesInvalidOneOf(self, passed_data, incorrect, data_label, *args):
    "Check raised within error context exception\n\n        Test that the exception has features pertaining to\n        failed 'oneOf' validation case of jsonschema\n\n        :param passed_data: dict to be serialized and passed for validation\n        :param incorrect: data value which doesn't pass the validation\n            and is present in error message of original exception\n        :param data_label: key name from passed_data one of which value\n            doesn't pass the validation; is present in the error message\n        :param *args: list of additional arguments passed to validation code\n\n        "
    context = self.get_invalid_data_context(passed_data, *args)
    self.assertIn("Failed validating 'oneOf' in schema", context.exception.message)
    err_msg = '{0} is not valid under any of the given schemas'
    self.assertIn(err_msg.format(incorrect), context.exception.message)
    self.assertIn('On instance{0}'.format(data_label), context.exception.message)

dataset/ETHPy150Open openstack/fuel-web/nailgun/nailgun/test/base.py BaseValidatorTest.assertRaisesInvalidOneOf/original