docstr: data - either raw bytes with data or just number of bytes in rawmode.
docstr_tok: ["data","-","either","raw","bytes","with","data","or","just","number","of","bytes","in","rawmode","."]
code: def assert_unpack(self, mode, rawmode, data, *pixels):
      """
      data - either raw bytes with data or just number of bytes in rawmode.
      """
      if isinstance(data, int):
          data_len = data * len(pixels)
          data = bytes(range(1, data_len + 1))
  
      im = Image.frombytes(
          mode, (len(pixels), 1), data, "raw", rawmode, 0, 1
      )
  
      for x, pixel in enumerate(pixels):
          assert pixel == im.getpixel((x, 0))
  
imports: from __future__ import annotations
  import sys
  import pytest
  from PIL import Image
label_desc: Use image node_id 1 for calling the TestLibUnpack obj's underlying member method code with example usage: obj.assert_unpack(mode, rawmode, data) without return types