Skip to content

Commit 4514e92

Browse files
committed
adjust test_px_wide.py
1 parent 03aa9e0 commit 4514e92

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

packages/python/plotly/plotly/tests/test_optional/test_px/test_px_wide.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
from pandas.testing import assert_frame_equal
77
import pytest
88
import warnings
9+
from plotly.tests.b64 import _b64
910

1011

1112
def test_is_col_list():
@@ -73,34 +74,34 @@ def test_wide_mode_external(px_fn, orientation, style):
7374
if style == "explicit":
7475
fig = px_fn(**{"data_frame": df, y: list(df.columns), x: df.index})
7576
assert len(fig.data) == 3
76-
assert list(fig.data[0][x]) == [11, 12, 13]
77-
assert list(fig.data[0][y]) == [1, 2, 3]
78-
assert list(fig.data[1][x]) == [11, 12, 13]
79-
assert list(fig.data[1][y]) == [4, 5, 6]
77+
assert fig.data[0][x] == _b64([11, 12, 13])
78+
assert fig.data[0][y] == _b64([1, 2, 3])
79+
assert fig.data[1][x] == _b64([11, 12, 13])
80+
assert fig.data[1][y] == _b64([4, 5, 6])
8081
assert fig.layout[xaxis].title.text == "index"
8182
assert fig.layout[yaxis].title.text == "value"
8283
assert fig.layout.legend.title.text == "variable"
8384
if px_fn in [px.density_heatmap]:
8485
if style == "explicit":
8586
fig = px_fn(**{"data_frame": df, y: list(df.columns), x: df.index})
8687
assert len(fig.data) == 1
87-
assert list(fig.data[0][x]) == [11, 12, 13, 11, 12, 13, 11, 12, 13]
88-
assert list(fig.data[0][y]) == [1, 2, 3, 4, 5, 6, 7, 8, 9]
88+
assert fig.data[0][x] == _b64([11, 12, 13, 11, 12, 13, 11, 12, 13])
89+
assert fig.data[0][y] == _b64([1, 2, 3, 4, 5, 6, 7, 8, 9])
8990
assert fig.layout[xaxis].title.text == "index"
9091
assert fig.layout[yaxis].title.text == "value"
9192
if px_fn in [px.violin, px.box, px.strip]:
9293
if style == "explicit":
9394
fig = px_fn(**{"data_frame": df, y: list(df.columns)})
9495
assert len(fig.data) == 1
9596
assert list(fig.data[0][x]) == ["a"] * 3 + ["b"] * 3 + ["c"] * 3
96-
assert list(fig.data[0][y]) == list(range(1, 10))
97+
assert fig.data[0][y] == _b64(range(1, 10))
9798
assert fig.layout[yaxis].title.text == "value"
9899
assert fig.layout[xaxis].title.text == "variable"
99100
if px_fn in [px.histogram]:
100101
if style == "explicit":
101102
fig = px_fn(**{"data_frame": df, x: list(df.columns)})
102103
assert len(fig.data) == 3
103-
assert list(fig.data[1][x]) == [4, 5, 6]
104+
assert fig.data[1][x] == _b64([4, 5, 6])
104105
assert fig.layout.legend.title.text == "variable"
105106
assert fig.layout[xaxis].title.text == "value"
106107

0 commit comments

Comments
 (0)