title: How can I get the number from iterator object. (Python2.7)
body: <p>A method returns iterator object.
  I want to check the number of data to test.</p>
  
  <p>I think it is a simple question, but I coundn't resolve it.</p>
  
  <pre><code>    records = a_function()
      self.assertEqual(1, len(records)) # TypeError: object of type 'listiterator' has no len()
  </code></pre>
  
  <p>Python2.7</p>