[Zope3-checkins] SVN: Zope3/trunk/src/zope/testbrowser/ rework some
of zope.testbrowser's attribute names to match style guide; this
Benji York
benji at zope.com
Tue Nov 29 14:57:30 EST 2005
Log message for revision 40414:
rework some of zope.testbrowser's attribute names to match style guide; this
should only effect users if the last_request_seconds and last_request_pystones
attributes
Changed:
U Zope3/trunk/src/zope/testbrowser/README.txt
U Zope3/trunk/src/zope/testbrowser/browser.py
-=-
Modified: Zope3/trunk/src/zope/testbrowser/README.txt
===================================================================
--- Zope3/trunk/src/zope/testbrowser/README.txt 2005-11-29 19:44:07 UTC (rev 40413)
+++ Zope3/trunk/src/zope/testbrowser/README.txt 2005-11-29 19:57:29 UTC (rev 40414)
@@ -1063,9 +1063,9 @@
pystones is usually a better choice.
>>> browser.open('http://localhost/@@/testbrowser/simple.html')
- >>> browser.last_request_seconds < 10 # really big number for safety
+ >>> browser.lastRequestSeconds < 10 # really big number for safety
True
- >>> browser.last_request_pystones < 10000 # really big number for safety
+ >>> browser.lastRequestPystones < 10000 # really big number for safety
True
Handling Errors
Modified: Zope3/trunk/src/zope/testbrowser/browser.py
===================================================================
--- Zope3/trunk/src/zope/testbrowser/browser.py 2005-11-29 19:44:07 UTC (rev 40413)
+++ Zope3/trunk/src/zope/testbrowser/browser.py 2005-11-29 19:57:29 UTC (rev 40414)
@@ -98,7 +98,7 @@
_pystones_per_second = None
@property
- def pystones_per_second(self):
+ def pystonesPerSecond(self):
"""How many pystones are equivalent to one second on this machine"""
if self._pystones_per_second == None:
self._pystones_per_second = pystone.pystones(pystone.LOOPS/10)[1]
@@ -114,7 +114,7 @@
self.end_time = time.time()
@property
- def elapsed_seconds(self):
+ def elapsedSeconds(self):
"""Elapsed time from calling `start` to calling `stop` or present time
If `stop` has been called, the timing period stopped then, otherwise
@@ -127,12 +127,12 @@
return end_time - self.start_time
@property
- def elapsed_pystones(self):
+ def elapsedPystones(self):
"""Elapsed pystones in timing period
See elapsed_seconds for definition of timing period.
"""
- return self.elapsed_seconds * self.pystones_per_second
+ return self.elapsedSeconds * self.pystonesPerSecond
class Browser(SetattrErrorsMixin):
@@ -217,12 +217,12 @@
self.timer.stop()
@property
- def last_request_pystones(self):
- return self.timer.elapsed_pystones
+ def lastRequestPystones(self):
+ return self.timer.elapsedPystones
@property
- def last_request_seconds(self):
- return self.timer.elapsed_seconds
+ def lastRequestSeconds(self):
+ return self.timer.elapsedSeconds
def reload(self):
"""See zope.testbrowser.interfaces.IBrowser"""
More information about the Zope3-Checkins
mailing list