code: def test_nan_to_null(self):
      array = [1, float("NaN"), float("Inf"), float("-Inf"), "platypus"]
      result = _json.dumps(array, cls=PlotlyJSONEncoder)
      expected_result = '[1, null, null, null, "platypus"]'
      self.assertEqual(result, expected_result)
  
file_path: plotly.py/packages/python/plotly/plotly/tests/test_core/test_utils/test_utils.py
imports: from unittest import TestCase
  from plotly.utils import PlotlyJSONEncoder, get_by_path, node_generator
  import json
label_desc: Use image node_id 1 for calling the TestJSONEncoder obj's underlying member method code with example usage: obj.test_nan_to_null() without return types