@@ -149,6 +149,11 @@ class AliasFileSyntaxTestCase(unittest.TestCase):
149
149
'online'
150
150
]
151
151
152
+ _known_boolean_attribute_values = [
153
+ 'true' ,
154
+ 'false'
155
+ ]
156
+
152
157
_folder_attributes_invalid_in_folder_params = [
153
158
ATTRIBUTES ,
154
159
FOLDERS
@@ -614,7 +619,7 @@ def _verify_attribute_default_value_attribute_value(self, folder_name, attribute
614
619
return []
615
620
616
621
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 )
618
623
619
624
def _verify_attribute_production_default_attribute_value (self , folder_name , attribute_name , alias_attribute_value ):
620
625
# 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
693
698
694
699
def _verify_boolean_value (self , folder_name , attribute_name , alias_attribute_name , alias_attribute_value ):
695
700
result = []
696
- constrained_string_values = ['true' , 'false' ]
697
701
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
+ )
704
708
elif type (alias_attribute_value ) is bool :
705
709
pass
706
710
elif isinstance (alias_attribute_value , PyRealBoolean ):
707
711
pass
708
712
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 ))
711
715
return result
712
716
713
717
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
817
821
818
822
return text % (folder_name , attribute_name , alias_attribute_name , str (type (alias_attribute_value )))
819
823
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
-
828
824
def _get_invalid_wlst_mode_message (self , folder_name , alias_attribute_name ):
829
825
text = 'Folder at path %s has invalid wlst mode type of %s'
830
826
result = text % (folder_name , alias_attribute_name )
0 commit comments