@@ -733,8 +733,8 @@ def test_call_signature(self):
733
733
def test_schema_generation (self ):
734
734
self .assertEqual (
735
735
self .ComponentClass ._schema ,
736
- {'optionalArray' : {'type' : 'list' }, 'optionalBool' : {'type' : 'boolean' }, 'optionalFunc' : {}, 'optionalNumber' : {'type' : 'number' }, 'optionalObject' : {'type' : 'dict' }, 'optionalString' : {'type' : 'string' }, 'optionalSymbol' : {}, 'optionalNode' : {'anyof' : [{'type' : 'component' }, {'type' : 'boolean' }, {'type' : 'number' }, {'type' : 'string' }, {'type' : 'list' , 'schema' : {'type' : ('component' , 'boolean' , 'number' , 'string' )}}]}, 'optionalElement' : {'type' : 'component' }, 'optionalMessage' : {}, 'optionalEnum' : {'allowed' : ['News' , 'Photos' , '1' , 1 , 1.0 , '2' , 2 , 2.0 ], 'type' : ('string' , 'number' )}, 'optionalUnion' : {'anyof' : [{'type' : 'string' }, {'type' : 'number' }, {}]}, 'optionalArrayOf' : {'type' : 'list' , 'schema' : {'type' : 'number' , 'nullable' : False }}, 'optionalObjectOf' : {'type' : 'dict' , 'nullable' : False , 'valueschema' : {'type' : 'number' }}, 'optionalObjectWithShapeAndNestedDescription' : {'type' : 'dict' , 'allow_unknown' : False , 'nullable' : False , 'schema' : {'color' : {'type' : 'string' }, 'fontSize' : {'type' : 'number' }, 'figure' : {'type' : 'dict' , 'allow_unknown' : False , 'nullable' : False , 'schema' : {'data' : {'type' : 'list' , 'schema' : {'type' : 'dict' , 'nullable' : False }}, 'layout' : {'type' : 'dict' }}}}}, 'optionalAny' : {'type' : ('boolean' , 'number' , 'string' , 'dict' , 'list' )}, 'customProp' : {}, 'customArrayProp' : {'type' : 'list' , 'schema' : {'nullable' : False }}, 'children' : {'anyof' : [{'type' : 'string' }, {'type' : 'number' }, {'type' : 'boolean' }, {'type' : 'component' }, {'allowed' : [None ], 'type' : ('string' , 'number' ), 'nullable' : True }, {'type' : 'list' , 'schema' : {'anyof' : [{'type' : 'string' }, {'type' : 'number' }, {'type' : 'boolean' }, {'type' : 'component' }, {'allowed' : [None ], 'type' : ('string' , 'number' ), 'nullable' : True }], 'nullable' : True }}], 'nullable' : True }, 'in' : {'type' : 'string' }, 'id' : {'type' : 'string' }, 'dashEvents' : {'allowed' : ['restyle' , 'relayout' , 'click' ], 'type' : ('string' , 'number' )}}
737
- )
736
+ {'customArrayProp' : {'type' : 'list' , 'schema' : {'nullable' : False }}, 'optionalObjectWithShapeAndNestedDescription' : {'nullable' : False , 'type' : 'dict' , 'allow_unknown' : False , 'schema' : {'color' : {'type' : 'string' }, 'fontSize' : {'type' : 'number' }, 'figure' : {'schema' : {'layout' : {'type' : 'dict' }, 'data' : {'type' : 'list' , 'schema' : {'type' : 'dict' , 'nullable' : False }}}, 'type' : 'dict' , 'allow_unknown' : False , 'nullable' : False }}}, 'optionalBool' : {'type' : 'boolean' }, 'optionalFunc' : {}, 'optionalSymbol' : {}, 'in' : {'type' : 'string' }, 'customProp' : {}, 'children' : {'anyof' : [{'type' : 'string' }, {'type' : 'number' }, {'type' : 'boolean' }, {'type' : 'component' }, {'nullable' : True , 'type' : ('string' , 'number' ), 'allowed' : [None ]}, {'type' : 'list' , 'schema' : {'anyof' : [{'type' : 'string' }, {'type' : 'number' }, {'type' : 'boolean' }, {'type' : 'component' }, {'nullable' : True , 'type' : ('string' , 'number' ), 'allowed' : [None ]}], 'nullable' : True }}], 'nullable' : True }, 'optionalMessage' : {}, 'optionalNumber' : {'type' : 'number' }, 'optionalObject' : {'type' : 'dict' }, 'dashEvents' : {'type' : ('string' , 'number' ), 'allowed' : ['restyle' , 'relayout' , 'click' ]}, 'id' : {'type' : 'string' }, 'optionalString' : {'type' : 'string' }, 'optionalElement' : {'type' : 'component' }, 'optionalArray' : {'type' : 'list' }, 'optionalNode' : {'anyof' : [{'type' : 'component' }, {'type' : 'boolean' }, {'type' : 'number' }, {'type' : 'string' }, {'type' : 'list' , 'schema' : {'type' : ('component' , 'boolean' , 'number' , 'string' )}}]}, 'optionalObjectOf' : {'type' : 'dict' , 'valueschema' : {'type' : 'number' }, 'nullable' : False }, 'optionalEnum' : {'type' : ('string' , 'number' ), 'allowed' : ['News' , 'Photos' , '1' , 1 , 1.0 , '2' , 2 , 2.0 , False , True ]}, 'optionalArrayOf' : {'type' : 'list' , 'schema' : {'type' : 'number' , 'nullable' : False }}, 'optionalUnion' : {'anyof' : [{'type' : 'string' }, {'type' : 'number' }, {}]}, 'optionalAny' : {'type' : ('boolean' , 'number' , 'string' , 'dict' , 'list' )}}
737
+ )
738
738
739
739
def test_required_props (self ):
740
740
with self .assertRaises (Exception ):
@@ -781,7 +781,7 @@ def setUp(self):
781
781
782
782
['optionalMessage' , '' ],
783
783
784
- ['optionalEnum' , 'a value equal to: \' News\' , \' Photos\' , 1, 2' ],
784
+ ['optionalEnum' , 'a value equal to: \' News\' , \' Photos\' , 1, 2, false, true ' ],
785
785
786
786
['optionalUnion' , 'string | number' ],
787
787
@@ -859,7 +859,7 @@ def assert_docstring(assertEqual, docstring):
859
859
"string or number; optional)" ,
860
860
861
861
"- optionalElement (dash component; optional)" ,
862
- "- optionalEnum (a value equal to: 'News', 'Photos', 1, 2; optional)" ,
862
+ "- optionalEnum (a value equal to: 'News', 'Photos', 1, 2, false, true ; optional)" ,
863
863
"- optionalUnion (string | number; optional)" ,
864
864
"- optionalArrayOf (list; optional)" ,
865
865
0 commit comments