class_docstr: Tests for sam.SamWriter.
code: def test_make_read_writer_tfrecords(self):
      outfile = test_utils.test_tmpfile("test.tfrecord")
      writer = sam.SamWriter(outfile, header=self.header)
  
      # Test that the writer is a context manager and that we can write a read to
      # it.
      with writer:
          writer.write(self.read1)
          writer.write(self.read2)
  
      # Our output should have exactly one read in it.
      self.assertEqual(
          [self.read1, self.read2],
          list(tfrecord.read_tfrecords(outfile, proto=reads_pb2.Read)),
      )
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import itertools
  from absl.testing import absltest
  from absl.testing import parameterized
  import six
  from etils import epath
  from third_party.nucleus.io import sam
  from third_party.nucleus.io import tfrecord
  from third_party.nucleus.protos import reads_pb2
  from third_party.nucleus.protos import reference_pb2
  from third_party.nucleus.testing import test_utils
  from third_party.nucleus.util import ranges
label_desc: Use image node_id 2 for calling the ReadWriterTests obj's underlying member method code with example usage: obj.test_make_read_writer_tfrecords() without return types