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

Function test_facet_col

tests/test_optional/test_px/test_imshow.py:419–434  ·  view source on GitHub ↗
(facet_col, binary_string)

Source from the content-addressed store, hash-verified

417@pytest.mark.parametrize("facet_col", [0, 1, 2, -1])
418@pytest.mark.parametrize("binary_string", [False, True])
419def test_facet_col(facet_col, binary_string):
420 img = np.random.randint(255, size=(10, 9, 8))
421 facet_col_wrap = 3
422 fig = px.imshow(
423 img,
424 facet_col=facet_col,
425 facet_col_wrap=facet_col_wrap,
426 binary_string=binary_string,
427 )
428 nslices = img.shape[facet_col]
429 ncols = int(facet_col_wrap)
430 nrows = nslices // ncols + 1 if nslices % ncols else nslices // ncols
431 nmax = ncols * nrows
432 assert "yaxis%d" % nmax in fig.layout
433 assert "yaxis%d" % (nmax + 1) not in fig.layout
434 assert len(fig.data) == nslices
435
436
437@pytest.mark.parametrize("animation_frame", [0, 1, 2, -1])

Callers

nothing calls this directly

Calls 1

intFunction · 0.85

Tested by

no test coverage detected