MCPcopy Index your code
hub / github.com/plotly/dash / test_to_plotly_json

Function test_to_plotly_json

tests/unit/development/test_generate_class.py:40–60  ·  view source on GitHub ↗
(component_class)

Source from the content-addressed store, hash-verified

38
39
40def test_to_plotly_json(component_class):
41 c = component_class()
42 assert c.to_plotly_json() == {
43 "namespace": "TableComponents",
44 "type": "Table",
45 "props": {"children": None},
46 }
47
48 c = component_class(id="my-id")
49 assert c.to_plotly_json() == {
50 "namespace": "TableComponents",
51 "type": "Table",
52 "props": {"children": None, "id": "my-id"},
53 }
54
55 c = component_class(id="my-id", optionalArray=None)
56 assert c.to_plotly_json() == {
57 "namespace": "TableComponents",
58 "type": "Table",
59 "props": {"children": None, "id": "my-id", "optionalArray": None},
60 }
61
62
63def test_arguments_become_attributes(component_class):

Callers

nothing calls this directly

Calls 2

component_classFunction · 0.85
to_plotly_jsonMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…