Skip to content

Commit

Permalink
Add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
teixas committed Apr 26, 2013
1 parent 9b773d8 commit f30e6c8
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions src/zope/testbrowser/tests/test_browser.py
Expand Up @@ -326,6 +326,45 @@ def test_relative_link():
"""


def test_links_without_href(self):
"""
>>> app = TestApp()
>>> browser = Browser(wsgi_app=app)
>>> app.set_next_response('''\
... <html><body>
... <a href="/foo">Foo</a>
... <a>Missing href</a>
... </body></html>
... ''')
>>> browser.open('http://localhost/')
GET / HTTP/1.1
...
>>> browser.getLink(url='/foo').url
'http://localhost/foo'
"""


def test_controls_without_value(self):
"""
>>> app = TestApp()
>>> browser = Browser(wsgi_app=app)
>>> app.set_next_response('''\
... <html><body>
... <form action="." method="post">
... <label for="foo-field">Foo Label</label>
... <input type="text" id="foo-field" value="Foo"/>
... <button type="submit">Submit</button>
... </form>
... </body></html>
... ''')
>>> browser.open('http://localhost/')
GET / HTTP/1.1
...
>>> browser.getControl('Foo Label').value
'Foo'
"""


def test_suite():
return doctest.DocTestSuite(
checker=zope.testbrowser.tests.helper.checker,
Expand Down

0 comments on commit f30e6c8

Please sign in to comment.