MCPcopy Create free account
hub / github.com/plotly/plotly.py / test_from_json

Function test_from_json

tests/test_io/test_to_from_json.py:74–82  ·  view source on GitHub ↗
(fig1)

Source from the content-addressed store, hash-verified

72# from_json
73# ---------
74def test_from_json(fig1):
75 fig1_json = json.dumps(fig1, **opts)
76 fig1_loaded = pio.from_json(fig1_json)
77
78 # Check return type
79 assert isinstance(fig1_loaded, go.Figure)
80
81 # Check return json
82 assert pio.to_json(fig1_loaded) == pio.to_json(fig1.to_dict())
83
84
85@pytest.mark.parametrize(

Callers

nothing calls this directly

Calls 2

to_dictMethod · 0.80
to_jsonMethod · 0.45

Tested by

no test coverage detected