docstr: Tests the output for the given parameters.
docstr_tok: ["Tests","the","output","for","the","given","parameters","."]
code: def runTest(self, relative_root, recursive):
      """Tests the output for the given parameters."""
      root_dir = os.path.join(self.root_dir, relative_root)
      expected_filenames = self.expected_dir_midi_contents[
          relative_root
      ]
      if recursive:
          for sub_dir in self.expected_sub_dirs[relative_root]:
              for filename in self.expected_dir_midi_contents[
                  os.path.join(relative_root, sub_dir)
              ]:
                  expected_filenames.add(
                      os.path.join(sub_dir, filename)
                  )
  
      with tempfile.NamedTemporaryFile(
          prefix="ConvertMidiDirToSequencesTest"
      ) as output_file:
          convert_dir_to_note_sequences.convert_directory(
              root_dir, output_file.name, recursive
          )
          actual_filenames = set()
          reader = tf.python_io.tf_record_iterator(output_file.name)
          for serialized_sequence in reader:
              sequence = music_pb2.NoteSequence.FromString(
                  serialized_sequence
              )
              self.assertEqual(
                  convert_dir_to_note_sequences.generate_note_sequence_id(
                      sequence.filename,
                      os.path.basename(relative_root),
                      "midi",
                  ),
                  sequence.id,
              )
              self.assertEqual(
                  os.path.basename(root_dir), sequence.collection_name
              )
              self.assertNotEqual(0, len(sequence.notes))
              actual_filenames.add(sequence.filename)
  
      self.assertEqual(expected_filenames, actual_filenames)
  
file_path: magenta/magenta/scripts/convert_dir_to_note_sequences_test.py
imports: import os
  import tempfile
  from magenta.scripts import convert_dir_to_note_sequences
  from note_seq import music_pb2
  import tensorflow.compat.v1
label_desc: Use image node_id 2 for calling the ConvertMidiDirToSequencesTest obj's underlying member method code with example usage: obj.runTest(relative_root, recursive) without return types