@@ -149,6 +149,11 @@ class AliasFileSyntaxTestCase(unittest.TestCase):
149149 'online'
150150 ]
151151
152+ _known_boolean_attribute_values = [
153+ 'true' ,
154+ 'false'
155+ ]
156+
152157 _folder_attributes_invalid_in_folder_params = [
153158 ATTRIBUTES ,
154159 FOLDERS
@@ -614,7 +619,7 @@ def _verify_attribute_default_value_attribute_value(self, folder_name, attribute
614619 return []
615620
616621 def _verify_attribute_derived_default_attribute_value (self , folder_name , attribute_name , alias_attribute_value ):
617- return []
622+ return self . _verify_boolean_value ( folder_name , attribute_name , DERIVED_DEFAULT , alias_attribute_value )
618623
619624 def _verify_attribute_production_default_attribute_value (self , folder_name , attribute_name , alias_attribute_value ):
620625 # nothing to verify - production_default can be any type or null
@@ -693,21 +698,20 @@ def _verify_attribute_wlst_type_attribute_value(self, folder_name, attribute_nam
693698
694699 def _verify_boolean_value (self , folder_name , attribute_name , alias_attribute_name , alias_attribute_value ):
695700 result = []
696- constrained_string_values = ['true' , 'false' ]
697701 if isinstance (alias_attribute_value , basestring ):
698- if alias_attribute_value . lower () not in constrained_string_values :
699- result . append ( self ._get_invalid_attribute_boolean_string_value_message ( folder_name , attribute_name ,
700- alias_attribute_name ,
701- alias_attribute_value ))
702- else :
703- pass
702+ result . extend (
703+ self ._verify_constrained_values (
704+ folder_name , attribute_name , alias_attribute_name , alias_attribute_value ,
705+ self . _known_boolean_attribute_values
706+ )
707+ )
704708 elif type (alias_attribute_value ) is bool :
705709 pass
706710 elif isinstance (alias_attribute_value , PyRealBoolean ):
707711 pass
708712 else :
709- result .append (self ._get_invalid_attribute_boolean_type_message (folder_name , attribute_name ,
710- alias_attribute_name , alias_attribute_value ))
713+ result .append (self ._get_invalid_attribute_boolean_type_message (
714+ folder_name , attribute_name , alias_attribute_name , alias_attribute_value ))
711715 return result
712716
713717 def _verify_constrained_values (self , folder_name , attribute_name , alias_attribute_name ,
@@ -817,14 +821,6 @@ def _get_invalid_attribute_boolean_type_message(self, folder_name, attribute_nam
817821
818822 return text % (folder_name , attribute_name , alias_attribute_name , str (type (alias_attribute_value )))
819823
820- def _get_invalid_attribute_boolean_string_value_message (self , folder_name , attribute_name ,
821- alias_attribute_name , alias_attribute_value ):
822- text = 'Folder at path %s has a defined attribute %s with alias attribute %s that is expected to ' \
823- 'be a boolean but its string value %s is not a valid boolean value'
824-
825- return text % (folder_name , attribute_name , alias_attribute_name , alias_attribute_value )
826-
827-
828824 def _get_invalid_wlst_mode_message (self , folder_name , alias_attribute_name ):
829825 text = 'Folder at path %s has invalid wlst mode type of %s'
830826 result = text % (folder_name , alias_attribute_name )
0 commit comments