Skip to content

Commit

Permalink
Changed the setup, so that the ftests directory is registered as a
Browse files Browse the repository at this point in the history
resource directory. Now we can provide a wide range of resources to test 
the test browser.
  • Loading branch information
strichter committed Jul 27, 2005
1 parent 1dcee23 commit c6504df
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 7 deletions.
19 changes: 13 additions & 6 deletions testbrowser/README.txt
Expand Up @@ -11,9 +11,9 @@ simulates a web browser similar to Mozilla Firefox or IE.

The browser can `open` web pages:

>>> browser.open('http://localhost/++etc++site/default')
>>> browser.open('http://localhost/@@/testbrowser/simple.html')
>>> browser.url
'http://localhost/++etc++site/default'
'http://localhost/@@/testbrowser/simple.html'


Page Contents
Expand All @@ -22,13 +22,20 @@ Page Contents
The contents of the current page are available:

>>> print browser.contents
<...
<html...>
<body...>
...
<html>
<head>
<title>Simple Page</title>
</head>
<body>
<h1>Simple Page</h1>
</body>
</html>
<BLANKLINE>

Making assertions about page contents are easy.

>>> browser.open('http://localhost/++etc++site/default')

>>> '<a href="RootErrorReportingUtility">' in browser.contents
True

Expand Down
1 change: 1 addition & 0 deletions testbrowser/ftests/__init__.py
@@ -0,0 +1 @@
# Make a package.
7 changes: 7 additions & 0 deletions testbrowser/ftests/ftesting.zcml
@@ -0,0 +1,7 @@
<configure xmlns="http://namespaces.zope.org/browser">

<resourceDirectory
name="testbrowser"
directory="." />

</configure>
8 changes: 8 additions & 0 deletions testbrowser/ftests/simple.html
@@ -0,0 +1,8 @@
<html>
<head>
<title>Simple Page</title>
</head>
<body>
<h1>Simple Page</h1>
</body>
</html>
3 changes: 2 additions & 1 deletion testbrowser/ftests/testdoc.py
Expand Up @@ -19,8 +19,9 @@
import unittest
from zope.app.testing.functional import FunctionalDocFileSuite


def test_suite():
return FunctionalDocFileSuite('README.txt')
return FunctionalDocFileSuite('../README.txt')

if __name__ == '__main__':
unittest.main(defaultTest='test_suite')

0 comments on commit c6504df

Please sign in to comment.