code: def testInvalidExtension(self):
      converter = upgrade_schema_lib.Converter()
      _, invalid_extension = tempfile.mkstemp(
          suffix=".foo"
      )  # safe to ignore fd
      with self.assertRaisesRegex(
          ValueError, "Invalid extension on input"
      ):
          converter.Convert(invalid_extension, invalid_extension)
      with tempfile.NamedTemporaryFile(
          suffix=".json", mode="w+"
      ) as in_json:
          JsonDumpAndFlush(EMPTY_TEST_SCHEMA_V1, in_json)
          with self.assertRaisesRegex(
              ValueError, "Invalid extension on output"
          ):
              converter.Convert(in_json.name, invalid_extension)
  
file_path: tensorflow-upstream/tensorflow/lite/schema/upgrade_schema_test.py
imports: import json
  import tempfile
  from tensorflow.lite.schema import upgrade_schema
  from tensorflow.python.framework import test_util
  from tensorflow.python.platform import test
label_desc: Use image node_id 2 for calling the TestSchemaUpgrade obj's underlying member method code with example usage: obj.testInvalidExtension() without return types