code: def testJsonFormat(self):
      p = Pool()
      p.add("key", "value")
  
      YamlOutput(filename="test.json", format="json", indent=4)(p)
      actual = open("test.json").read()
      expected = (
          '{\n"metadata": {\n    "version": {\n        "essentia": "'
          + version()
          + '"\n    }\n},\n"key": ["value"]\n}'
      )
  
      self.assertEqual(expected, actual)
      os.unlink("test.json")
  
      # No indent flag gives indent 4
      YamlOutput(filename="test.json", format="json")(p)
      actual = open("test.json").read()
      self.assertEqual(expected, actual)
  
      YamlOutput(filename="test.json", format="json", indent=0)(p)
      actual = open("test.json").read()
  
      expected = (
          '{"metadata": {"version": {"essentia": "'
          + version()
          + '"}},"key": ["value"]}'
      )
      self.assertEqual(expected, actual)
      os.unlink("test.json")
  
imports: from essentia_test import *
  from essentia._essentia import version
  import os
  import json
label_desc: Use image node_id 18 for calling the TestYamlOutput obj's underlying member method code with example usage: obj.testJsonFormat() without return types