

def testRegisterNode(self):

    class MetadataTestNodeC(Gaffer.Node):

        def __init__(self, name='MetadataTestNodeC'):
            Gaffer.Node.__init__(self, name)
            self['a'] = Gaffer.IntPlug()
            self['b'] = Gaffer.IntPlug()
    IECore.registerRunTimeTyped(MetadataTestNodeC)
    Gaffer.Metadata.registerNode(MetadataTestNodeC, 'description', '\n\t\t\tI am a multi\n\t\t\tline description\n\t\t\t', 'nodeGadget:color', IECore.Color3f(1, 0, 0), plugs={
        'a': ['description', 'Another multi\n\t\t\t\t\tline description', 'preset:One', 1, 'preset:Two', 2, 'preset:Three', 3],
        'b': ('description', '\n\t\t\t\t\tI am the first paragraph.\n\n\t\t\t\t\tI am the second paragraph.\n\t\t\t\t\t', 'otherValue', 100),
    })
    n = MetadataTestNodeC()
    self.assertEqual(Gaffer.Metadata.nodeValue(n, 'description'), 'I am a multi\nline description')
    self.assertEqual(Gaffer.Metadata.nodeValue(n, 'nodeGadget:color'), IECore.Color3f(1, 0, 0))
    n.assertEqual(Gaffer.Metadata.plugValue(n['a'], 'description'), 'Another multi\nline description')
    self.assertEqual(Gaffer.Metadata.plugValue(n['a'], 'preset:One'), 1)
    self.assertEqual(Gaffer.Metadata.plugValue(n['a'], 'preset:Two'), 2)
    self.assertEqual(Gaffer.Metadata.plugValue(n['a'], 'preset:Three'), 3)
    self.assertEqual(Gaffer.Metadata.registeredPlugValues(n['a']), ['description', 'preset:One', 'preset:Two', 'preset:Three'])
    self.assertEqual(Gaffer.Metadata.plugValue(n['b'], 'description'), 'I am the first paragraph.\n\nI am the second paragraph.')
    self.assertEqual(Gaffer.Metadata.plugValue(n['b'], 'otherValue'), 100)

dataset/ETHPy150Open ImageEngine/gaffer/python/GafferTest/MetadataTest.py MetadataTest.testRegisterNode/VarMisuse@193/419 `self`->`n`