Skip to content

Commit fbb3f65

Browse files
committed
added test
1 parent b689a2f commit fbb3f65

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

packages/python/plotly/plotly/tests/test_core/test_px/test_imshow.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -171,14 +171,16 @@ def test_zmin_zmax_range_color_source():
171171
assert fig1 == fig2
172172

173173

174-
def test_imshow_xarray():
174+
@pytest.mark.parametrize("binary_string", [False, True])
175+
def test_imshow_xarray(binary_string):
175176
img = np.random.random((20, 30))
176177
da = xr.DataArray(img, dims=["dim_rows", "dim_cols"])
177-
fig = px.imshow(da)
178+
fig = px.imshow(da, binary_string=binary_string)
178179
# Dimensions are used for axis labels and coordinates
179180
assert fig.layout.xaxis.title.text == "dim_cols"
180181
assert fig.layout.yaxis.title.text == "dim_rows"
181-
assert np.all(np.array(fig.data[0].x) == np.array(da.coords["dim_cols"]))
182+
if not binary_string:
183+
assert np.all(np.array(fig.data[0].x) == np.array(da.coords["dim_cols"]))
182184

183185

184186
def test_imshow_labels_and_ranges():

0 commit comments

Comments
 (0)