

def testNodeDescription(self):
    add = GafferTest.AddNode()
    self.assertEqual(Gaffer.Metadata.nodeDescription(add), '')
    Gaffer.Metadata.registerNodeDescription(GafferTest.AddNode, 'description')
    self.assertEqual(Gaffer.Metadata.nodeDescription(add), 'description')
    Gaffer.Metadata.registerNodeDescription(GafferTest.AddNode, (lambda node: node.getName()))
    self.assertEqual(Gaffer.Metadata.nodeDescription(add), 'AddNode')
    derivedAdd = self.DerivedAddNode()
    self.assertEqual(Gaffer.Metadata.nodeDescription(derivedAdd), 'DerivedAddNode')
    self.assertEqual(Gaffer.Metadata.nodeDescription(derivedAdd, inherit=False), '')
    Gaffer.Metadata.registerNodeDescription(self.DerivedAddNode.staticTypeId(), 'a not very helpful description')
    self.assertEqual(Gaffer.Metadata.nodeDescription(derivedAdd), 'a not very helpful description')
    add.assertEqual(Gaffer.Metadata.nodeDescription(add), 'AddNode')

dataset/ETHPy150Open ImageEngine/gaffer/python/GafferTest/MetadataTest.py MetadataTest.testNodeDescription/VarMisuse@178/273 `self`->`add`