[Checkins] SVN: gocept.selenium/trunk/src/gocept/selenium/ Ensure the get/set tests don't cause a server error.
Christian Theune
ct at gocept.com
Thu Apr 1 07:49:59 EDT 2010
Log message for revision 110384:
Ensure the get/set tests don't cause a server error.
Provide a separate test for dealing with response codes in the 5xx area.
Changed:
U gocept.selenium/trunk/src/gocept/selenium/tests/fixture/configure.zcml
U gocept.selenium/trunk/src/gocept/selenium/tests/fixture/dummy.py
U gocept.selenium/trunk/src/gocept/selenium/ztk/tests/test_ztk.py
-=-
Modified: gocept.selenium/trunk/src/gocept/selenium/tests/fixture/configure.zcml
===================================================================
--- gocept.selenium/trunk/src/gocept/selenium/tests/fixture/configure.zcml 2010-04-01 05:50:46 UTC (rev 110383)
+++ gocept.selenium/trunk/src/gocept/selenium/tests/fixture/configure.zcml 2010-04-01 11:49:59 UTC (rev 110384)
@@ -19,6 +19,13 @@
<browser:page
for="*"
+ name="error.html"
+ class=".dummy.Error"
+ permission="zope.Public"
+ />
+
+ <browser:page
+ for="*"
name="display-delay.html"
template="display-delay.pt"
permission="zope.Public"
Modified: gocept.selenium/trunk/src/gocept/selenium/tests/fixture/dummy.py
===================================================================
--- gocept.selenium/trunk/src/gocept/selenium/tests/fixture/dummy.py 2010-04-01 05:50:46 UTC (rev 110383)
+++ gocept.selenium/trunk/src/gocept/selenium/tests/fixture/dummy.py 2010-04-01 11:49:59 UTC (rev 110384)
@@ -27,4 +27,10 @@
def __call__(self):
c = zope.security.proxy.removeSecurityProxy(self.context)
- return str(c.foo)
+ return str(getattr(c, 'foo', 0))
+
+
+class Error(object):
+
+ def __call__(Self):
+ raise ValueError()
Modified: gocept.selenium/trunk/src/gocept/selenium/ztk/tests/test_ztk.py
===================================================================
--- gocept.selenium/trunk/src/gocept/selenium/ztk/tests/test_ztk.py 2010-04-01 05:50:46 UTC (rev 110383)
+++ gocept.selenium/trunk/src/gocept/selenium/ztk/tests/test_ztk.py 2010-04-01 11:49:59 UTC (rev 110384)
@@ -15,7 +15,8 @@
import gocept.selenium.ztk.testing
import gocept.selenium.tests.isolation
-
class ZTKTests(gocept.selenium.tests.isolation.IsolationTests,
gocept.selenium.ztk.testing.TestCase):
- pass
+
+ def test_selenium_http_500_handling(self):
+ self.selenium.open('http://%s/error.html' % self.selenium.server)
More information about the checkins
mailing list