Skip to content

Commit af1d88d

Browse files
committed
Fix expected JSON in html export (no spaces)
1 parent a651a63 commit af1d88d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

packages/python/plotly/plotly/tests/test_core/test_offline/test_offline.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ def _read_html(self, file_url):
8888
return f.read()
8989

9090
def test_default_plot_generates_expected_html(self):
91-
layout_json = _json.dumps(fig["layout"], cls=plotly.utils.PlotlyJSONEncoder)
91+
layout_json = pio.json.to_json_plotly(fig["layout"])
9292

9393
html = self._read_html(
9494
plotly.offline.plot(fig, auto_open=False, filename=html_filename)
@@ -98,8 +98,8 @@ def test_default_plot_generates_expected_html(self):
9898
# instead just make sure a few of the parts are in here?
9999
self.assertIn("Plotly.newPlot", html) # plot command is in there
100100

101-
x_data = '"x": [1, 2, 3]'
102-
y_data = '"y": [10, 20, 30]'
101+
x_data = '"x":[1,2,3]'
102+
y_data = '"y":[10,20,30]'
103103

104104
self.assertTrue(x_data in html and y_data in html) # data in there
105105
self.assertIn(layout_json, html) # so is layout

0 commit comments

Comments
 (0)