code: def test_namedtuple_dump(self):
      for v in [Value(1), Point(1, 2), DuckValue(1), DuckPoint(1, 2)]:
          d = v._asdict()
          sio = StringIO()
          json.dump(v, sio)
          self.assertEqual(d, json.loads(sio.getvalue()))
          sio = StringIO()
          json.dump(v, sio, namedtuple_as_object=True)
          self.assertEqual(d, json.loads(sio.getvalue()))
          sio = StringIO()
          json.dump(v, sio, tuple_as_array=False)
          self.assertEqual(d, json.loads(sio.getvalue()))
          sio = StringIO()
          json.dump(
              v, sio, namedtuple_as_object=True, tuple_as_array=False
          )
          self.assertEqual(d, json.loads(sio.getvalue()))
  
imports: from __future__ import absolute_import
  import unittest
  import simplejson
  from simplejson.compat import StringIO
label_desc: Use image node_id 3 for calling the TestNamedTuple obj's underlying member method code with example usage: obj.test_namedtuple_dump() without return types