code: def test_wavefront():
      """Test wavefront reader"""
      fname_mesh = load_data_file("orig/triceratops.obj.gz")
      fname_out = op.join(temp_dir, "temp.obj")
      mesh1 = read_mesh(fname_mesh)
      assert_raises(IOError, read_mesh, "foo.obj")
      assert_raises(ValueError, read_mesh, op.abspath(__file__))
      assert_raises(
          ValueError, write_mesh, fname_out, *mesh1, format="foo"
      )
      write_mesh(fname_out, mesh1[0], mesh1[1], mesh1[2], mesh1[3])
      assert_raises(IOError, write_mesh, fname_out, *mesh1)
      write_mesh(fname_out, *mesh1, overwrite=True)
      mesh2 = read_mesh(fname_out)
      assert_equal(len(mesh1), len(mesh2))
      for m1, m2 in zip(mesh1, mesh2):
          if m1 is None:
              assert_equal(m2, None)
          else:
              assert_allclose(m1, m2, rtol=1e-5)
      # test our efficient normal calculation routine
      assert_allclose(
          mesh1[2],
          _slow_calculate_normals(mesh1[0], mesh1[1]),
          rtol=1e-7,
          atol=1e-7,
      )
  
file_path: vispy/vispy/io/tests/test_io.py
imports: import numpy
  from os import path
  from numpy.testing import assert_allclose, assert_array_equal
  from vispy.io import write_mesh, read_mesh, load_data_file
  from vispy.geometry import _fast_cross_3d
  from vispy.util import _TempDir
  from vispy.testing import run_tests_if_main, assert_equal, assert_raises, requires_ssl
label_desc: Use image node_id 1 for calling a global function with example usage: test_wavefront() without return types