code: def test_round_trip():
      # test that colormap survives a round trip.
      # note that while both input and output are in BYTE,
      # internally the colors are stored as float; thus
      # there is a conversion BYTE -> float -> BYTE
      nPts = 256
      zebra = np.zeros((nPts, 3), dtype=np.uint8)
      zebra[1::2, :] = 255
      cmap = pg.ColorMap(None, zebra)
      lut = cmap.getLookupTable(nPts=nPts)
      assert np.all(lut == zebra)
  
file_path: pyqtgraph/tests/test_colormap.py
imports: import pytest
  import numpy
  import pyqtgraph
  from pyqtgraph.Qt import QtGui
label_desc: Use image node_id 4 for calling a global function with example usage: test_round_trip() without return types