Closed tom-mun closed 6 months ago
Just as a note, this occurs in the same manner when the output is set up via the UI instead of programmatically.
def __init__(self, *args):
super().__init__(*args)
self.outputProp = Double(0)
self.childStep = ChildTest()
self.ChildTestSteps.Add(self.childStep)
self.InputOutputRelation(self.childStep, "inputProp", self, "outputProp")
def InputOutputRelation(self, inputstep, inputparam: str, outputstep, outputparam: str):
inmem = OpenTap.TypeData.GetTypeData(inputstep).GetMember(inputparam)
outmem = OpenTap.TypeData.GetTypeData(outputstep).GetMember(outputparam)
OpenTap.InputOutputRelation.Assign(inputstep, inmem, outputstep, outmem)
def Run(self):
self.outputProp = Double(5)
self.RunChildStep(self.childStep)
self.childStep
is not supported in this way. When the test plan is loaded ChildTestSteps are overwritten and self.childStep still refers to the old step. Instead of self.childStep, use self.ChildTestSteps[0] or something like that.
Environment Python package 3.0.0 (also tested on 3.1.0) OpenTAP 9.19.4
Details
It appears some outputs do not propagate when the following are true:
testPy.zip
I have attached some example code with 2 parent steps that both use the same child step. The only difference between the parent steps is one uses RunChildStep, and one uses RunChildSteps(). The child step will fail if it receives an input equal to 0 (default). If the output propagates, the child step input is set to 5, and the step passes.
To recreate, once the code is loaded,