[twill commit] r78 - fixed issue #14; showforms now returns a list, and as does showlinks, and this

5 views
Skip to first unread message

codesite...@google.com

unread,
Apr 11, 2009, 3:51:18 PM4/11/09
to twill-...@googlegroups.com
Author: the.good.doctor.is.in
Date: Sat Apr 11 12:37:55 2009
New Revision: 78

Added:
branches/0.9.2-dev/twill/tests/test-commands-api.py
Modified:
branches/0.9.2-dev/twill/twill/commands.py

Log:
fixed issue #14; showforms now returns a list, and as does showlinks, and
this
behavior is tested.

Added: branches/0.9.2-dev/twill/tests/test-commands-api.py
==============================================================================
--- (empty file)
+++ branches/0.9.2-dev/twill/tests/test-commands-api.py Sat Apr 11 12:37:55
2009
@@ -0,0 +1,21 @@
+"""
+Test (some aspects of) the public API of the commands module.
+"""
+
+import twilltestlib
+from twill import commands as tc
+
+def test_showforms_gives_list():
+ url = twilltestlib.get_url()
+ tc.go(url)
+
+ tc.go('/simpleform')
+ r = tc.showforms()
+ assert isinstance(r, list), "showforms should return a list"
+
+def test_showlinks_gives_list():
+ url = twilltestlib.get_url()
+ tc.go(url)
+
+ r = tc.showlinks()
+ assert isinstance(r, list), "showlinks should return a list"

Modified: branches/0.9.2-dev/twill/twill/commands.py
==============================================================================
--- branches/0.9.2-dev/twill/twill/commands.py (original)
+++ branches/0.9.2-dev/twill/twill/commands.py Sat Apr 11 12:37:55 2009
@@ -342,7 +342,7 @@
Show all of the forms on the current page.
"""
browser.showforms()
- return browser._browser.forms()
+ return list(browser._browser.forms())

def showlinks():
"""

Reply all
Reply to author
Forward
0 new messages