# Path: ironicclient/exc.py
# class AmbiguousAuthSystem(exceptions.ClientException):
# class InvalidAttribute(exceptions.ClientException):
# class StateTransitionFailed(exceptions.ClientException):
# class StateTransitionTimeout(exceptions.ClientException):
# def from_response(response, message=None, traceback=None, method=None,
#                   url=None):
# 
# Path: ironicclient/tests/unit/utils.py
# class BaseTestCase(testtools.TestCase):
# class FakeAPI(object):
# class FakeConnection(object):
# class FakeResponse(object):
#     def setUp(self):
#     def __init__(self, responses, path_prefix=None):
#     def _request(self, method, url, headers=None, body=None, params=None):
#     def raw_request(self, *args, **kwargs):
#     def json_request(self, *args, **kwargs):
#     def __init__(self, response=None, path_prefix=None):
#     def request(self, method, conn_url, **kwargs):
#     def setresponse(self, response):
#     def getresponse(self):
#     def __repr__(self):
#     def __init__(self, headers, body=None, version=None, status=None,
#                  reason=None, request_headers={}):
#     def getheaders(self):
#     def getheader(self, key, default):
#     def read(self, amt):
#     def __repr__(self):
# def mockSessionResponse(headers, content=None, status_code=None, version=None,
#                         request_headers={}):
# def mockSession(headers, content=None, status_code=None, version=None):
# 
# Path: ironicclient/v1/create_resources.py
# def create_resources(client, filenames):
#     """Create resources using their JSON or YAML descriptions.
# 
#     :param client: an instance of ironic client;
#     :param filenames: a list of filenames containing JSON or YAML resources
#         definitions.
#     :raises: ClientException if any operation during files processing/resource
#         creation fails.
#     """
#     errors = []
#     resources = []
#     for resource_file in filenames:
#         try:
#             resource = load_from_file(resource_file)
#             jsonschema.validate(resource, _CREATE_SCHEMA)
#             resources.append(resource)
#         except (exc.ClientException, jsonschema.ValidationError) as e:
#             errors.append(e)
#     if errors:
#         raise exc.ClientException('While validating the resources file(s), the'
#                                   ' following error(s) were encountered:\n%s' %
#                                   '\n'.join(str(e) for e in errors))
#     for r in resources:
#         errors.extend(create_chassis(client, r.get('chassis', [])))
#         errors.extend(create_nodes(client, r.get('nodes', [])))
#     if errors:
#         raise exc.ClientException('During resources creation, the following '
#                                   'error(s) were encountered:\n%s' %
#                                   '\n'.join(str(e) for e in errors))


import builtins
import jsonschema
from unittest import mock
from ironicclient import exc
from ironicclient.tests.unit import utils
from ironicclient.v1 import create_resources
            }]
        }]
    }],
    "nodes": [{
        "driver": "fake",
        "driver_info": {
            "fake_key": "fake",
            "dict_prop": {
                "a": "b"
            },
            "arr_prop": [
                1, 2, 3
            ]
        },
        "chassis_uuid": "10f99593-b8c2-4fcb-8858-494c1a47cee6"
    }]
}

ironic_pov_invalid_json = {
    "nodes": [{
        "driver": "non_existent",
        "ports": [{
            "address": "invalid_address"
        }]
    }]
}

schema_pov_invalid_json = {"meow": "woof!"}



# Path: ironicclient/exc.py
# class AmbiguousAuthSystem(exceptions.ClientException):
# class InvalidAttribute(exceptions.ClientException):
# class StateTransitionFailed(exceptions.ClientException):
# class StateTransitionTimeout(exceptions.ClientException):
# def from_response(response, message=None, traceback=None, method=None,
#                   url=None):
# 
# Path: ironicclient/tests/unit/utils.py
# class BaseTestCase(testtools.TestCase):
# class FakeAPI(object):
# class FakeConnection(object):
# class FakeResponse(object):
#     def setUp(self):
#     def __init__(self, responses, path_prefix=None):
#     def _request(self, method, url, headers=None, body=None, params=None):
#     def raw_request(self, *args, **kwargs):
#     def json_request(self, *args, **kwargs):
#     def __init__(self, response=None, path_prefix=None):
#     def request(self, method, conn_url, **kwargs):
#     def setresponse(self, response):
#     def getresponse(self):
#     def __repr__(self):
#     def __init__(self, headers, body=None, version=None, status=None,
#                  reason=None, request_headers={}):
#     def getheaders(self):
#     def getheader(self, key, default):
#     def read(self, amt):
#     def __repr__(self):
# def mockSessionResponse(headers, content=None, status_code=None, version=None,
#                         request_headers={}):
# def mockSession(headers, content=None, status_code=None, version=None):
# 
# Path: ironicclient/v1/create_resources.py
# def create_resources(client, filenames):
#     """Create resources using their JSON or YAML descriptions.
# 
#     :param client: an instance of ironic client;
#     :param filenames: a list of filenames containing JSON or YAML resources
#         definitions.
#     :raises: ClientException if any operation during files processing/resource
#         creation fails.
#     """
#     errors = []
#     resources = []
#     for resource_file in filenames:
#         try:
#             resource = load_from_file(resource_file)
#             jsonschema.validate(resource, _CREATE_SCHEMA)
#             resources.append(resource)
#         except (exc.ClientException, jsonschema.ValidationError) as e:
#             errors.append(e)
#     if errors:
#         raise exc.ClientException('While validating the resources file(s), the'
#                                   ' following error(s) were encountered:\n%s' %
#                                   '\n'.join(str(e) for e in errors))
#     for r in resources:
#         errors.extend(create_chassis(client, r.get('chassis', [])))
#         errors.extend(create_nodes(client, r.get('nodes', [])))
#     if errors:
#         raise exc.ClientException('During resources creation, the following '
#                                   'error(s) were encountered:\n%s' %
#                                   '\n'.join(str(e) for e in errors))


# Path: ironicclient/tests/unit/v1/test_create_resources.py
import builtins
import jsonschema
from unittest import mock
from ironicclient import exc
from ironicclient.tests.unit import utils
from ironicclient.v1 import create_resources

            }]
        }]
    }],
    "nodes": [{
        "driver": "fake",
        "driver_info": {
            "fake_key": "fake",
            "dict_prop": {
                "a": "b"
            },
            "arr_prop": [
                1, 2, 3
            ]
        },
        "chassis_uuid": "10f99593-b8c2-4fcb-8858-494c1a47cee6"
    }]
}

ironic_pov_invalid_json = {
    "nodes": [{
        "driver": "non_existent",
        "ports": [{
            "address": "invalid_address"
        }]
    }]
}

schema_pov_invalid_json = {"meow": "woof!"}



class CreateSchemaTest(utils.BaseTestCase):