def test_to_plotly_json_with_null_arguments(self): c = Component(id='a') c._prop_names = ( 'id', 'style', ) c._type = 'MyComponent' c._namespace = 'basic' self.assertEqual(c.to_plotly_json(), { 'namespace': 'basic', 'props': { 'id': 'a' }, 'type': 'MyComponent' }) c = Component(id='a', style=None) c._prop_names = ( 'id', 'style', ) c._type = 'MyComponent' c._namespace = 'basic' self.assertEqual( c.to_plotly_json(), { 'namespace': 'basic', 'props': { 'id': 'a', 'style': None }, 'type': 'MyComponent' })
def test_to_plotly_json_with_nested_children(self): c1 = Component(id='1', children='Hello World') c1._prop_names = ('id', 'children',) c1._type = 'MyComponent' c1._namespace = 'basic' c2 = Component(id='2', children=c1) c2._prop_names = ('id', 'children',) c2._type = 'MyComponent' c2._namespace = 'basic' c3 = Component(id='3', children='Hello World') c3._prop_names = ('id', 'children',) c3._type = 'MyComponent' c3._namespace = 'basic' c4 = Component(id='4', children=[c2, c3]) c4._prop_names = ('id', 'children',) c4._type = 'MyComponent' c4._namespace = 'basic' def to_dict(id, children): return { 'namespace': 'basic', 'props': { 'id': id, 'children': children }, 'type': 'MyComponent' } """
def test_to_plotly_json_with_nested_children(self): c1 = Component(id='1', children='Hello World') c1._prop_names = ('id', 'children',) c1._type = 'MyComponent' c1._namespace = 'basic' c2 = Component(id='2', children=c1) c2._prop_names = ('id', 'children',) c2._type = 'MyComponent' c2._namespace = 'basic' c3 = Component(id='3', children='Hello World') c3._prop_names = ('id', 'children',) c3._type = 'MyComponent' c3._namespace = 'basic' c4 = Component(id='4', children=[c2, c3]) c4._prop_names = ('id', 'children',) c4._type = 'MyComponent' c4._namespace = 'basic' def to_dict(id, children): return { 'namespace': 'basic', 'props': { 'id': id, 'children': children }, 'type': 'MyComponent' } """
def test_debc021_to_plotly_json_with_null_arguments(): c = Component(id="a") c._prop_names = ("id", "style") c._type = "MyComponent" c._namespace = "basic" assert c.to_plotly_json() == { "namespace": "basic", "props": { "id": "a" }, "type": "MyComponent", } c = Component(id="a", style=None) c._prop_names = ("id", "style") c._type = "MyComponent" c._namespace = "basic" assert c.to_plotly_json() == { "namespace": "basic", "props": { "id": "a", "style": None }, "type": "MyComponent", }
def test_to_plotly_json_without_children(self): c = Component(id='a') c._prop_names = ('id',) c._type = 'MyComponent' c._namespace = 'basic' self.assertEqual( c.to_plotly_json(), {'namespace': 'basic', 'props': {'id': 'a'}, 'type': 'MyComponent'} )
def test_to_plotly_json_without_children(self): c = Component(id='a') c._prop_names = ('id',) c._type = 'MyComponent' c._namespace = 'basic' self.assertEqual( c.to_plotly_json(), {'namespace': 'basic', 'props': {'id': 'a'}, 'type': 'MyComponent'} )
def test_debc020_to_plotly_json_without_children(): c = Component(id="a") c._prop_names = ("id",) c._type = "MyComponent" c._namespace = "basic" assert c.to_plotly_json() == { "namespace": "basic", "props": {"id": "a"}, "type": "MyComponent", }
def test_to_plotly_json_with_null_arguments(self): c = Component(id='a') c._prop_names = ('id', 'style',) c._type = 'MyComponent' c._namespace = 'basic' self.assertEqual( c.to_plotly_json(), {'namespace': 'basic', 'props': {'id': 'a'}, 'type': 'MyComponent'} ) c = Component(id='a', style=None) c._prop_names = ('id', 'style',) c._type = 'MyComponent' c._namespace = 'basic' self.assertEqual( c.to_plotly_json(), { 'namespace': 'basic', 'props': {'id': 'a', 'style': None}, 'type': 'MyComponent' } )
def test_debc022_to_plotly_json_with_children(): c = Component(id="a", children="Hello World") c._prop_names = ("id", "children") c._type = "MyComponent" c._namespace = "basic" assert c.to_plotly_json() == { "namespace": "basic", "props": { "id": "a", # TODO - Rename 'children' to 'children' "children": "Hello World", }, "type": "MyComponent", }
def test_to_plotly_json_with_children(self): c = Component(id='a', children='Hello World') c._prop_names = ('id', 'children',) c._type = 'MyComponent' c._namespace = 'basic' self.assertEqual( c.to_plotly_json(), { 'namespace': 'basic', 'props': { 'id': 'a', # TODO - Rename 'children' to 'children' 'children': 'Hello World' }, 'type': 'MyComponent' } )
def test_to_plotly_json_with_children(self): c = Component(id='a', children='Hello World') c._prop_names = ('id', 'children',) c._type = 'MyComponent' c._namespace = 'basic' self.assertEqual( c.to_plotly_json(), { 'namespace': 'basic', 'props': { 'id': 'a', # TODO - Rename 'children' to 'children' 'children': 'Hello World' }, 'type': 'MyComponent' } )
def test_debc023_to_plotly_json_with_wildcards(): c = Component( id="a", **{"aria-expanded": "true", "data-toggle": "toggled", "data-none": None} ) c._prop_names = ("id",) c._type = "MyComponent" c._namespace = "basic" assert c.to_plotly_json() == { "namespace": "basic", "props": { "aria-expanded": "true", "data-toggle": "toggled", "data-none": None, "id": "a", }, "type": "MyComponent", }
def test_to_plotly_json_with_wildcards(self): c = Component(id='a', **{'aria-expanded': 'true', 'data-toggle': 'toggled', 'data-none': None}) c._prop_names = ('id',) c._type = 'MyComponent' c._namespace = 'basic' self.assertEqual( c.to_plotly_json(), {'namespace': 'basic', 'props': { 'aria-expanded': 'true', 'data-toggle': 'toggled', 'data-none': None, 'id': 'a', }, 'type': 'MyComponent'} )
def test_to_plotly_json_with_wildcards(self): c = Component(id='a', **{'aria-expanded': 'true', 'data-toggle': 'toggled', 'data-none': None}) c._prop_names = ('id',) c._type = 'MyComponent' c._namespace = 'basic' self.assertEqual( c.to_plotly_json(), {'namespace': 'basic', 'props': { 'aria-expanded': 'true', 'data-toggle': 'toggled', 'data-none': None, 'id': 'a', }, 'type': 'MyComponent'} )