[qmtest] PATCH: Create resource classes from test classes

Mark Mitchell mark at codesourcery.com
Fri Sep 2 14:57:24 UTC 2005


Stefan Seefeld wrote:

> In other words, it seems your resource_adapter() function assumes the 
> caller
> has already figured out it got a Test class name where a Resource class 
> name
> was expected, and now only needs to do the wrapping.

In a Python module, if you have done:

   class MyTestClass(Test):

     def Run(self, context, result):

       ...

you can now do:

   MyResourceBase = resource_adapter(MyTestClass)
   class MyResourceClass(MyResourceBase):

     pass

Now, MyResourceClass is a legitimate Resource.

There are some other changes for the "generic database" work that are in 
my local tree that make it easier to take advantage of this, but they'll 
take a bit more cleaning up.

-- 
Mark Mitchell
CodeSourcery, LLC
mark at codesourcery.com
(916) 791-8304



More information about the qmtest mailing list