Context handling bug?

Vladimir Prus ghost at cs.msu.su
Wed Jul 9 11:05:16 UTC 2003


Hello,
I seem to have trouble using context with current CVS HEAD. Symptoms: I've got 
command.ShellCommandTest test and it makes use of QMV_root shell variable. 
The context file contains the definition of "root" variable, which should be 
translated to QMV_root. However, by the time test class' Run method is 
called, the variable is not here.

It disappears in target.py:201, which reads:

            context = Context(context)

The problem is that "Context" __init__ method stores passed context in member 
variable __context. It correctly overrides __getitem__ to look both in self 
and in self.__context, but it seems does not override necessary iteration 
methods. As the result, this code from command.py 
(ExecTestBase.MakeEnvironment):

        for key, value in context.items():
            if "." not in key and type(value) == types.StringType:
                name = "QMV_" + key
                environment[name] = value

does not see the assingments in context.__context.

Unfortunately, I cannot quickly fix this, because I never did emulation of 
mappings. Any ideas what should be added?

- Volodya






More information about the qmtest mailing list