def test__invalid_without_required(self, attr, value, message):
        obj = ConfigObject(ENTERPRISE_SPEC_VALIDATE)

        # Name is required value, make sure it is set
        obj.name = 'a'

        setattr(obj, attr, value)

        if (message == "value is mandatory"):
            assert obj.validate(skip_required_check=True) is True
        else:
            assert obj.validate(skip_required_check=True) is False
            attr_error = obj.errors[attr]
            assert message in attr_error['description']
    def test__invalid(self, attr, value, message):
        obj = ConfigObject(ENTERPRISE_SPEC_VALIDATE)

        # Name is required value, make sure it is set
        obj.name = 'a'

        setattr(obj, attr, value)

        assert obj.validate() is False
        attr_error = obj.errors[attr]
        assert message in attr_error['description']
    def test__valid(self):
        obj = ConfigObject(ENTERPRISE_SPEC_VALIDATE)

        obj.name = 'a'
        assert hasattr(obj, 'name') is True
        assert obj.validate() is True

        obj.name = 'a' * 255
        assert hasattr(obj, 'name') is True
        assert obj.validate() is True

        obj.name = 'a'
        obj.enableapplicationperformancemanagement = False
        obj.floatingipsquota = 0
        obj.allowedforwardingclasses = []
        obj.encryptionmanagementmode = "DISABLED"
        assert obj.validate() is True

        obj.name = 'a' * 255
        obj.enableapplicationperformancemanagement = True
        obj.floatingipsquota = 250000
        obj.allowedforwardingclasses = ["A", "B"]
        obj.encryptionmanagementmode = "MANAGED"
        assert obj.validate() is True