[Checkins] SVN: gocept.selenium/trunk/ Extracted 'host' and 'port' as class attributes of gocept.selenium.ztk.Layer
Marius Gedminas
marius at pov.lt
Tue Jan 12 06:45:58 EST 2010
Log message for revision 108052:
Extracted 'host' and 'port' as class attributes of gocept.selenium.ztk.Layer
so subclasses can override them; stopped hardcoding 8087 as the server port.
Changed:
U gocept.selenium/trunk/CHANGES.txt
U gocept.selenium/trunk/setup.py
U gocept.selenium/trunk/src/gocept/selenium/base.py
U gocept.selenium/trunk/src/gocept/selenium/ztk/__init__.py
-=-
Modified: gocept.selenium/trunk/CHANGES.txt
===================================================================
--- gocept.selenium/trunk/CHANGES.txt 2010-01-12 05:39:19 UTC (rev 108051)
+++ gocept.selenium/trunk/CHANGES.txt 2010-01-12 11:45:57 UTC (rev 108052)
@@ -1,10 +1,11 @@
Changes
=======
-0.2.2 (unreleased)
-------------------
+0.3 (unreleased)
+----------------
-- Nothing changed yet.
+- Extracted 'host' and 'port' as class attributes of gocept.selenium.ztk.Layer
+ so subclasses can override them; stopped hardcoding 8087 as the server port.
0.2.1 (2009-12-18)
Modified: gocept.selenium/trunk/setup.py
===================================================================
--- gocept.selenium/trunk/setup.py 2010-01-12 05:39:19 UTC (rev 108051)
+++ gocept.selenium/trunk/setup.py 2010-01-12 11:45:57 UTC (rev 108052)
@@ -18,7 +18,7 @@
setup(
name='gocept.selenium',
- version = '0.2.2dev',
+ version = '0.3dev',
author='Wolfgang Schnerring',
author_email='ws at gocept.com',
description='zope.testing layer that integrates Selenium-RC',
Modified: gocept.selenium/trunk/src/gocept/selenium/base.py
===================================================================
--- gocept.selenium/trunk/src/gocept/selenium/base.py 2010-01-12 05:39:19 UTC (rev 108051)
+++ gocept.selenium/trunk/src/gocept/selenium/base.py 2010-01-12 11:45:57 UTC (rev 108052)
@@ -18,12 +18,14 @@
class Layer(object):
- # XXX make configurable
+ # XXX make configurable:
+ # hostname and port of the Selenium RC server
_server = 'localhost'
_port = 4444
_browser = '*firefox'
- # override in subclass
+ # override in subclass:
+ # hostname and port of the app web server
host = None
port = None
Modified: gocept.selenium/trunk/src/gocept/selenium/ztk/__init__.py
===================================================================
--- gocept.selenium/trunk/src/gocept/selenium/ztk/__init__.py 2010-01-12 05:39:19 UTC (rev 108051)
+++ gocept.selenium/trunk/src/gocept/selenium/ztk/__init__.py 2010-01-12 11:45:57 UTC (rev 108052)
@@ -24,20 +24,20 @@
class Layer(gocept.selenium.base.Layer):
+ # Hostname and port of the Zope webserver
+ host = 'localhost'
+ port = 8087
+
def setUp(self):
task_dispatcher = ThreadedTaskDispatcher()
task_dispatcher.setThreadCount(1)
db = zope.app.testing.functional.FunctionalTestSetup().db
self.http = SwitchableDBServerType.create(
- 'WSGI-HTTP', task_dispatcher, db, port=8087)
+ 'WSGI-HTTP', task_dispatcher, db, port=self.port)
thread = threading.Thread(target=zope.app.server.main.run)
thread.setDaemon(True)
thread.start()
- # XXX make configurable
- self.host = 'localhost'
- self.port = '8087'
-
super(Layer, self).setUp()
def switch_db(self):
@@ -75,4 +75,4 @@
zope.server.http.wsgihttpserver.WSGIHTTPServer,
SwitchableDBApplication,
zope.server.http.commonaccesslogger.CommonAccessLogger,
- 8087, True)
+ 8087, True) # The port number here is just the default value
More information about the checkins
mailing list