code: def test_bad_inputs(self):
      basepath = self.tempdir.name
      rdd = self.sc.parallelize(range(1, 4)).map(lambda x: (x, "a" * x))
      self.assertRaises(
          Exception,
          lambda: rdd.saveAsHadoopFile(
              basepath + "/badinputs/saveAsHadoopFile/",
              "org.apache.hadoop.mapred.NotValidOutputFormat",
          ),
      )
      self.assertRaises(
          Exception,
          lambda: rdd.saveAsNewAPIHadoopFile(
              basepath + "/badinputs/saveAsNewAPIHadoopFile/",
              "org.apache.hadoop.mapreduce.lib.output.NotValidOutputFormat",
          ),
      )
  
imports: import os
  import shutil
  import tempfile
  import unittest
  from pyspark.testing.utils import ReusedPySparkTestCase, SPARK_HOME
label_desc: Use image node_id 6 for calling the OutputFormatTests obj's underlying member method code with example usage: obj.test_bad_inputs() without return types