[Zodb-checkins] SVN: ZODB/branches/3.9/src/ Bug fixed

Jim Fulton jim at zope.com
Mon Sep 20 17:50:59 EDT 2010


Log message for revision 116692:
  Bug fixed
    The verbose mode of the fstest was broken.
    (https://bugs.launchpad.net/zodb/+bug/475996)
  

Changed:
  U   ZODB/branches/3.9/src/CHANGES.txt
  U   ZODB/branches/3.9/src/ZODB/scripts/fstest.py
  A   ZODB/branches/3.9/src/ZODB/scripts/tests/test_fstest.py

-=-
Modified: ZODB/branches/3.9/src/CHANGES.txt
===================================================================
--- ZODB/branches/3.9/src/CHANGES.txt	2010-09-20 21:37:01 UTC (rev 116691)
+++ ZODB/branches/3.9/src/CHANGES.txt	2010-09-20 21:50:58 UTC (rev 116692)
@@ -64,6 +64,9 @@
   update or to constructors, causing Python to exit under certain
   circumstances.
 
+- The verbose mode of the fstest was broken.
+  (https://bugs.launchpad.net/zodb/+bug/475996)
+
 3.9.5 (2010-04-23)
 ==================
 

Modified: ZODB/branches/3.9/src/ZODB/scripts/fstest.py
===================================================================
--- ZODB/branches/3.9/src/ZODB/scripts/fstest.py	2010-09-20 21:37:01 UTC (rev 116691)
+++ ZODB/branches/3.9/src/ZODB/scripts/fstest.py	2010-09-20 21:50:58 UTC (rev 116692)
@@ -203,11 +203,14 @@
     print __doc__
     sys.exit(-1)
 
-def main():
+def main(args=None):
+    if args is None:
+        args = sys.argv[1:]
     import getopt
 
+    global VERBOSE
     try:
-        opts, args = getopt.getopt(sys.argv[1:], 'v')
+        opts, args = getopt.getopt(args, 'v')
         if len(args) != 1:
             raise ValueError("expected one argument")
         for k, v in opts:

Copied: ZODB/branches/3.9/src/ZODB/scripts/tests/test_fstest.py (from rev 116470, ZODB/trunk/src/ZODB/scripts/tests/test_fstest.py)
===================================================================
--- ZODB/branches/3.9/src/ZODB/scripts/tests/test_fstest.py	                        (rev 0)
+++ ZODB/branches/3.9/src/ZODB/scripts/tests/test_fstest.py	2010-09-20 21:50:58 UTC (rev 116692)
@@ -0,0 +1,44 @@
+##############################################################################
+#
+# Copyright (c) 2010 Zope Foundation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+from zope.testing import setupstack
+import doctest
+import ZODB
+
+def test_fstest_verbose():
+    r"""
+    >>> db = ZODB.DB('data.fs')
+    >>> db.close()
+    >>> import ZODB.scripts.fstest
+    >>> ZODB.scripts.fstest.main(['data.fs'])
+
+    >>> ZODB.scripts.fstest.main(['data.fs'])
+
+    >>> ZODB.scripts.fstest.main(['-v', 'data.fs'])
+    ... # doctest: +ELLIPSIS +NORMALIZE_WHITESPACE
+             4: transaction tid ... #0
+    no errors detected
+
+    >>> ZODB.scripts.fstest.main(['-vvv', 'data.fs'])
+    ... # doctest: +ELLIPSIS +NORMALIZE_WHITESPACE
+            52: object oid 0x0000000000000000 #0
+             4: transaction tid ... #0
+    no errors detected
+
+    """
+
+
+def test_suite():
+    return doctest.DocTestSuite(
+        setUp=setupstack.setUpDirectory, tearDown=setupstack.tearDown)
+



More information about the Zodb-checkins mailing list