code: def test_tuple_array_dump(self):
      t = (1, 2, 3)
      expect = json.dumps(list(t))
      # Default is True
      sio = StringIO()
      json.dump(t, sio)
      self.assertEqual(expect, sio.getvalue())
      sio = StringIO()
      json.dump(t, sio, tuple_as_array=True)
      self.assertEqual(expect, sio.getvalue())
      self.assertRaises(
          TypeError, json.dump, t, StringIO(), tuple_as_array=False
      )
      # Ensure that the "default" does not get called
      sio = StringIO()
      json.dump(t, sio, default=repr)
      self.assertEqual(expect, sio.getvalue())
      sio = StringIO()
      json.dump(t, sio, tuple_as_array=True, default=repr)
      self.assertEqual(expect, sio.getvalue())
      # Ensure that the "default" gets called
      sio = StringIO()
      json.dump(t, sio, tuple_as_array=False, default=repr)
      self.assertEqual(json.dumps(repr(t)), sio.getvalue())
  
imports: import unittest
  from simplejson.compat import StringIO
  import simplejson
label_desc: Use image node_id 2 for calling the TestTuples obj's underlying member method code with example usage: obj.test_tuple_array_dump() without return types