<div dir="ltr">I&#39;m trying to mock access to my postgres database using the mock framework. I saw the cursor example <a href="http://mock.readthedocs.org/en/latest/getting-started.html?highlight=cursor#setting-return-values-and-attributes" target="_blank">here</a>. The psycopg2 cursor however does not return the data set but is iterated over example <span></span><span></span><a href="http://initd.org/psycopg/docs/cursor.html" target="_blank">here</a>
 under result retrieval methods. What would be the best way to mock a 
cursor which can be called with a function but also be iterated over.<br>

<br>Thanks for any assistance and sorry for the inexperienced question.<br clear="all"><br>-- <br><div dir="ltr">Alexander Bandukwala<div><span title="Call with Google Voice">337-335-0133</span></div><div>Twitter: <a href="http://twitter.com/abanduk" target="_blank">http://twitter.com/abanduk</a></div>

<div>Site: <a href="http://bandukwala.me/" target="_blank">http://bandukwala.me</a></div><div><br></div></div>
</div>