[qmtest] attributes and the gui don't like each other
Zack Weinberg
zack at codesourcery.com
Tue Aug 6 20:30:28 UTC 2002
On Tue, Aug 06, 2002 at 03:43:28PM -0400, Mike Carifio wrote:
> On RH7.1 or RH7.3, Python 2.2.1 and QMTest 1.1.5:
>
> # Create a new db with an attribute author=carifio at usys.com (for no good
> reason).
> [carifio at qmtest qm]$ qmtest -D firstdb create-tdb --attribute
> author=carifio at usys.com
> QMTest has created a new test database at /home/carifio/qm/firstdb.
>
>
> # Take a look at the empty database
> [carifio at qmtest qm]$ qmtest -D firstdb gui --address $(hostname -i)
> --port 8888 --no-browser
> Traceback (most recent call last):
> File "/usr/local/lib/qm/qm/test/qmtest.py", line 78, in ?
> command.Execute(sys.stdout)
> File "/usr/local/lib/qm/qm/test/cmdline.py", line 401, in Execute
> self.__database = base.load_database(db_path)
> File "/usr/local/lib/qm/qm/test/base.py", line 137, in load_database
> return apply(database_class, (db_path,), attributes)
> TypeError: __init__() got an unexpected keyword argument 'author'
I think I just fixed this bug. Please apply the appended patch to
your copy of xmldb.py (in /usr/local/lib/qm/qm/test, if you installed
QMTest in the default location) and try again. You may need to run
compileall.py on that directory after applying the patch.
> What are attributes actually used for?
Some of them are for communication between internal objects. Others
are just for the user's benefit.
zw
===================================================================
Index: xmldb.py
--- xmldb.py 2002/06/28 23:44:12 1.45
+++ xmldb.py 2002/08/06 20:08:44
@@ -69,14 +69,14 @@ class Database(ExtensionDatabase):
# specifying an argument which doesn't exist in the test class. For
# these, we raise an 'TestFileError'.
- def __init__(self, path):
+ def __init__(self, path, **attributes):
"""Open a connection to a database.
'path' -- The absolute path to the directory that represents
the database."""
# Initialize base classes.
- ExtensionDatabase.__init__(self, path)
+ ExtensionDatabase.__init__(self, path, **attributes)
# Create an AttachmentStore for this database.
self.__store = AttachmentStore(path, self)
# Make sure the database path exists.
More information about the qmtest
mailing list