def test_array_config_validation(self):
        class TestConf(schema.Schema):
            item = schema.ArrayItem(
                title="Dog Names",
                description="Name your dogs",
                items=schema.StringItem(),
            )

        try:
            jsonschema.validate(
                {"item": ["Tobias", "Óscar"]},
                TestConf.serialize(),
                format_checker=jsonschema.FormatChecker(),
            )
        except jsonschema.exceptions.ValidationError as exc:
            self.fail("ValidationError raised: {}".format(exc))

        with self.assertRaises(jsonschema.exceptions.ValidationError) as excinfo:
            jsonschema.validate(
                {"item": ["Tobias", "Óscar", 3]},
                TestConf.serialize(),
                format_checker=jsonschema.FormatChecker(),
            )
        self.assertIn("is not of type", excinfo.exception.message)

        class TestConf(schema.Schema):
            item = schema.ArrayItem(
                title="Dog Names",
                description="Name your dogs",
                items=schema.StringItem(),
                min_items=1,
                max_items=2,
            )

        try:
            jsonschema.validate(
                {"item": ["Tobias", "Óscar"]},
                TestConf.serialize(),
                format_checker=jsonschema.FormatChecker(),
            )
        except jsonschema.exceptions.ValidationError as exc:
            self.fail("ValidationError raised: {}".format(exc))

        with self.assertRaises(jsonschema.exceptions.ValidationError) as excinfo:
            jsonschema.validate(
                {"item": ["Tobias", "Óscar", "Pepe"]},
                TestConf.serialize(),
                format_checker=jsonschema.FormatChecker(),
            )
        self.assertIn("is too long", excinfo.exception.message)

        with self.assertRaises(jsonschema.exceptions.ValidationError) as excinfo:
            jsonschema.validate(
                {"item": []},
                TestConf.serialize(),
                format_checker=jsonschema.FormatChecker(),
            )
        self.assertIn("is too short", excinfo.exception.message)

        class TestConf(schema.Schema):
            item = schema.ArrayItem(
                title="Dog Names",
                description="Name your dogs",
                items=schema.StringItem(),
                uniqueItems=True,
            )

        with self.assertRaises(jsonschema.exceptions.ValidationError) as excinfo:
            jsonschema.validate(
                {"item": ["Tobias", "Tobias"]},
                TestConf.serialize(),
                format_checker=jsonschema.FormatChecker(),
            )
        self.assertIn("has non-unique elements", excinfo.exception.message)

        class TestConf(schema.Schema):
            item = schema.ArrayItem(items=(schema.StringItem(), schema.IntegerItem()))

        try:
            jsonschema.validate(
                {"item": ["Óscar", 4]},
                TestConf.serialize(),
                format_checker=jsonschema.FormatChecker(),
            )
        except jsonschema.exceptions.ValidationError as exc:
            self.fail("ValidationError raised: {}".format(exc))

        with self.assertRaises(jsonschema.exceptions.ValidationError) as excinfo:
            jsonschema.validate(
                {"item": ["Tobias", "Óscar"]},
                TestConf.serialize(),
                format_checker=jsonschema.FormatChecker(),
            )
        self.assertIn("is not of type", excinfo.exception.message)

        class TestConf(schema.Schema):
            item = schema.ArrayItem(
                items=schema.ArrayItem(
                    items=(schema.StringItem(), schema.IntegerItem())
                )
            )

        try:
            jsonschema.validate(
                {"item": [["Tobias", 8], ["Óscar", 4]]},
                TestConf.serialize(),
                format_checker=jsonschema.FormatChecker(),
            )
        except jsonschema.exceptions.ValidationError as exc:
            self.fail("ValidationError raised: {}".format(exc))

        with self.assertRaises(jsonschema.exceptions.ValidationError) as excinfo:
            jsonschema.validate(
                {"item": [["Tobias", 8], ["Óscar", "4"]]},
                TestConf.serialize(),
                format_checker=jsonschema.FormatChecker(),
            )
        self.assertIn("is not of type", excinfo.exception.message)

        class TestConf(schema.Schema):
            item = schema.ArrayItem(items=schema.StringItem(enum=["Tobias", "Óscar"]))

        try:
            jsonschema.validate(
                {"item": ["Óscar"]},
                TestConf.serialize(),
                format_checker=jsonschema.FormatChecker(),
            )
        except jsonschema.exceptions.ValidationError as exc:
            self.fail("ValidationError raised: {}".format(exc))
        try:
            jsonschema.validate(
                {"item": ["Tobias"]},
                TestConf.serialize(),
                format_checker=jsonschema.FormatChecker(),
            )
        except jsonschema.exceptions.ValidationError as exc:
            self.fail("ValidationError raised: {}".format(exc))

        with self.assertRaises(jsonschema.exceptions.ValidationError) as excinfo:
            jsonschema.validate(
                {"item": ["Pepe"]},
                TestConf.serialize(),
                format_checker=jsonschema.FormatChecker(),
            )
        self.assertIn("is not one of", excinfo.exception.message)