docstr: PNG output data is b64 unicode
docstr_tok: ["PNG","output","data","is","b64","unicode"]
code: def test_read_png(self):
      """PNG output data is b64 unicode"""
      s = writes(nb0)
      nb1 = nbjson.reads(s)
      found_png = False
      for cell in nb1.worksheets[0].cells:
          if "outputs" not in cell:
              continue
          for output in cell.outputs:
              if "png" in output:
                  found_png = True
                  pngdata = output["png"]
                  self.assertEqual(type(pngdata), str)
                  # test that it is valid b64 data
                  b64bytes = pngdata.encode("ascii")
                  raw_bytes = decodebytes(b64bytes)
      assert found_png, "never found png output"
  
file_path: nbformat/tests/v3/test_json.py
imports: from __future__ import annotations
  import copy
  import json
  from base64 import decodebytes
  from unittest import TestCase
  from nbformat.v3 import nbjson
  from nbformat.v3.nbbase import from_dict
  from nbformat.v3.nbjson import writes
  from .None import formattest
  from .nbexamples import nb0
label_desc: Use image node_id 5 for calling the TestJSON obj's underlying member method code with example usage: obj.test_read_png() without return types