

def testChildAccess(self):
    n = Gaffer.Node()
    n['c'] = Gaffer.CompoundPlug()
    n['c']['i'] = Gaffer.IntPlug()
    n['c']['s'] = Gaffer.StringPlug()
    pw = GafferUI.CompoundPlugValueWidget(n['c'])
    self.assertEqual(pw.childPlugValueWidget(n['c']['i']), None)
    self.assertEqual(pw.childPlugValueWidget(n['c']['s']), None)
    self.failUnless(isinstance(pw.childPlugValueWidget(n['c']['i'], lazy=False), GafferUI.PlugValueWidget))
    self.failUnless(isinstance(pw.childPlugValueWidget(n['c']['s'], lazy=False), GafferUI.PlugValueWidget))
    pw = GafferUI.CompoundPlugValueWidget(n['c'], collapsed=None)
    w = GafferUI.Window()
    w.setChild(pw)
    w.setVisible(True)
    self.failUnless(isinstance(pw.childPlugValueWidget(pw['c']['i']), GafferUI.PlugValueWidget))
    self.failUnless(isinstance(pw.childPlugValueWidget(n['c']['s']), GafferUI.PlugValueWidget))

dataset/ETHPy150Open ImageEngine/gaffer/python/GafferUITest/CompoundPlugValueWidgetTest.py CompoundPlugValueWidgetTest.testChildAccess/VarMisuse@215/319 `n`->`pw`