code: def test_save_as():
      with open("test/fixtures/img1.jpg", "rb") as f:
          image_bytes = f.read()
      save_as(
          image_data=image_bytes,
          output_name="test_pdf.pdf",
          file_type="pdf",
      )
      os.unlink("test_pdf.pdf")
      save_as(
          image_data=image_bytes,
          output_name="test_gif.gif",
          file_type="gif",
      )
      os.unlink("test_gif.gif")
      save_as(
          image_data=image_bytes,
          output_name="test_eps.eps",
          file_type="eps",
      )
      os.unlink("test_eps.eps")
  
file_path: pyecharts/test/test_snapshot.py
imports: import os
  from unittest.mock import patch
  from nose.tools import assert_equal, raises
  from pyecharts.charts import Bar
  from pyecharts.render import make_snapshot
  from pyecharts.render.snapshot import save_as, save_as_png, save_as_text, decode_base64
label_desc: Use image node_id 5 for calling a global function with example usage: test_save_as() without return types