def test_number_config_validation(self):
        class TestConf(schema.Schema):
            item = schema.NumberItem(title="How many dogs", description="Question")

        try:
            jsonschema.validate({"item": 2}, TestConf.serialize())
        except jsonschema.exceptions.ValidationError as exc:
            self.fail("ValidationError raised: {}".format(exc))

        with self.assertRaises(jsonschema.exceptions.ValidationError) as excinfo:
            jsonschema.validate({"item": "3"}, TestConf.serialize())
        self.assertIn("is not of type", excinfo.exception.message)

        class TestConf(schema.Schema):
            item = schema.NumberItem(
                title="How many dogs", description="Question", multiple_of=2.2
            )

        try:
            jsonschema.validate({"item": 4.4}, TestConf.serialize())
        except jsonschema.exceptions.ValidationError as exc:
            self.fail("ValidationError raised: {}".format(exc))

        with self.assertRaises(jsonschema.exceptions.ValidationError) as excinfo:
            jsonschema.validate({"item": 4}, TestConf.serialize())
        self.assertIn("is not a multiple of", excinfo.exception.message)

        class TestConf(schema.Schema):
            item = schema.NumberItem(
                title="Foo", description="Foo Item", minimum=1, maximum=10
            )

        try:
            jsonschema.validate({"item": 3}, TestConf.serialize())
        except jsonschema.exceptions.ValidationError as exc:
            self.fail("ValidationError raised: {}".format(exc))

        with self.assertRaises(jsonschema.exceptions.ValidationError) as excinfo:
            jsonschema.validate({"item": 11}, TestConf.serialize())
        self.assertIn("is greater than the maximum of", excinfo.exception.message)

        class TestConf(schema.Schema):
            item = schema.NumberItem(
                title="Foo", description="Foo Item", minimum=10, maximum=100
            )

        with self.assertRaises(jsonschema.exceptions.ValidationError) as excinfo:
            jsonschema.validate({"item": 3}, TestConf.serialize())
        self.assertIn("is less than the minimum of", excinfo.exception.message)

        class TestConf(schema.Schema):
            item = schema.NumberItem(
                title="How many dogs",
                description="Question",
                minimum=0,
                exclusive_minimum=True,
                maximum=10,
                exclusive_maximum=True,
            )

        with self.assertRaises(jsonschema.exceptions.ValidationError) as excinfo:
            jsonschema.validate({"item": 0}, TestConf.serialize())
        self.assertIn(
            "is less than or equal to the minimum of", excinfo.exception.message
        )

        with self.assertRaises(jsonschema.exceptions.ValidationError) as excinfo:
            jsonschema.validate({"item": 10}, TestConf.serialize())
        self.assertIn(
            "is greater than or equal to the maximum of", excinfo.exception.message
        )

        class TestConf(schema.Schema):
            item = schema.NumberItem(
                title="Foo", description="Foo Item", enum=(0, 2, 4, 6)
            )

        try:
            jsonschema.validate({"item": 4}, TestConf.serialize())
        except jsonschema.exceptions.ValidationError as exc:
            self.fail("ValidationError raised: {}".format(exc))

        class TestConf(schema.Schema):
            item = schema.NumberItem(
                title="Foo", description="Foo Item", enum=(0, 2, 4, 6)
            )

        with self.assertRaises(jsonschema.exceptions.ValidationError) as excinfo:
            jsonschema.validate({"item": 3}, TestConf.serialize())
        self.assertIn("is not one of", excinfo.exception.message)