Skip to content

Commit c64bc6d

Browse files
committed
Update Table test component for boolean enum values
1 parent c8f2953 commit c64bc6d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

tests/development/test_base_component.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -733,8 +733,8 @@ def test_call_signature(self):
733733
def test_schema_generation(self):
734734
self.assertEqual(
735735
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+
)
738738

739739
def test_required_props(self):
740740
with self.assertRaises(Exception):
@@ -781,7 +781,7 @@ def setUp(self):
781781

782782
['optionalMessage', ''],
783783

784-
['optionalEnum', 'a value equal to: \'News\', \'Photos\', 1, 2'],
784+
['optionalEnum', 'a value equal to: \'News\', \'Photos\', 1, 2, false, true'],
785785

786786
['optionalUnion', 'string | number'],
787787

@@ -859,7 +859,7 @@ def assert_docstring(assertEqual, docstring):
859859
"string or number; optional)",
860860

861861
"- 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)",
863863
"- optionalUnion (string | number; optional)",
864864
"- optionalArrayOf (list; optional)",
865865

0 commit comments

Comments
 (0)