code: def test_iterate(self):
      # Check the in-memory fasta file's iterable matches the info in the header.
      expected_names = [
          contig.name for contig in self.fasta_reader.header.contigs
      ]
      expected_lengths = [
          contig.n_bases for contig in self.fasta_reader.header.contigs
      ]
      in_mem_records = list(self.in_mem.iterate())
      self.assertLen(
          in_mem_records, len(self.fasta_reader.header.contigs)
      )
      self.assertEqual([r[0] for r in in_mem_records], expected_names)
      self.assertEqual(
          [len(r[1]) for r in in_mem_records], expected_lengths
      )
  
      # Check the in-memory fasta file's iterable matches that of the indexed
      # fasta file.
      fasta_records = list(self.fasta_reader.iterate())
      self.assertEqual(in_mem_records, fasta_records)
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from absl.testing import absltest
  from absl.testing import parameterized
  import six
  from third_party.nucleus.io import fasta
  from third_party.nucleus.io.python import reference
  from third_party.nucleus.testing import test_utils
  from third_party.nucleus.util import ranges
label_desc: Use image node_id 7 for calling the InMemoryFastaReaderTests obj's underlying member method code with example usage: obj.test_iterate() without return types