extending FileDatabase

Stefan Seefeld seefeld at sympatico.ca
Thu Nov 27 19:35:10 UTC 2003


hi there,

I'm trying to define my own test database that is basically
a file database, i.e. which defines an association between tests
and files...with some exceptions.

My first guess was to derive from FileDatabase, but that
doesn't seem to be as straight forward as it sounds:

The method 'GetTest' (which, as it is documented, must not be
overridden), calls 'GetTestPath'. The latter returns a path,
which has to fulfill '_IsTestFile' or 'NoSuchTestError' will
be raised.

Then '_GetTestFromPath' is used to actually instantiate the
test, given the path. However, here the path goes through
'os.path.normpath', which generates different results depending
on the platform.

This is fine as long as I'm going to access real files. But
if I want to deal with 'virtual files', i.e. names that really
just refer to tests without any file association, it's a bit
cumbersome.

What is the suggested way to define a test database that 'mostly'
operates on test files, but also allows other 'mixin' tests ?

Thanks,
		Stefan




More information about the qmtest mailing list