[wwwsearch-commits] r29185 - wwwsearch/mechanize/trunk/test
jjlee at codespeak.net
jjlee at codespeak.net
Thu Jun 22 23:35:07 CEST 2006
Author: jjlee
Date: Thu Jun 22 23:35:06 2006
New Revision: 29185
Added:
wwwsearch/mechanize/trunk/test/test_html.doctest
Log:
Add missing html doctest. NOTE FUMBLED LAST COMMIT (-r29184), here's the message for everything except test/test_history.doctest in commit 29184: Fix subtle bug in CachingGeneratorFunction (benji at zope.com)
Added: wwwsearch/mechanize/trunk/test/test_html.doctest
==============================================================================
--- (empty file)
+++ wwwsearch/mechanize/trunk/test/test_html.doctest Thu Jun 22 23:35:06 2006
@@ -0,0 +1,44 @@
+>>> from mechanize._html import CachingGeneratorFunction
+
+>>> i = [1]
+>>> func = CachingGeneratorFunction(i)
+>>> list(func())
+[1]
+>>> list(func())
+[1]
+
+>>> i = [1, 2, 3]
+>>> func = CachingGeneratorFunction(i)
+>>> list(func())
+[1, 2, 3]
+
+>>> i = func()
+>>> i.next()
+1
+>>> i.next()
+2
+>>> i.next()
+3
+
+>>> i = func()
+>>> j = func()
+>>> i.next()
+1
+>>> j.next()
+1
+>>> i.next()
+2
+>>> j.next()
+2
+>>> j.next()
+3
+>>> i.next()
+3
+>>> i.next()
+Traceback (most recent call last):
+...
+StopIteration
+>>> j.next()
+Traceback (most recent call last):
+...
+StopIteration
More information about the wwwsearch-commits
mailing list