

def testStringSerialisationWithNewlinesAndQuotes(self):
    trickyStrings = ['Paragraph 1\n\nParagraph 2', "'Quote'", "Apostrophe's", '"Double quote"']
    script = Gaffer.ScriptNode()
    self['n'] = Gaffer.Node()
    for s in trickyStrings:
        p = Gaffer.IntPlug(flags=(Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic))
        script['n']['user'].addChild(p)
        Gaffer.Metadata.registerPlugValue(p, 'description', s)
    script2 = Gaffer.ScriptNode()
    script2.execute(script.serialise())
    for (p, s) in zip(script2['n']['user'].children(), trickyStrings):
        self.assertEqual(Gaffer.Metadata.plugDescription(p), s)

dataset/ETHPy150Open ImageEngine/gaffer/python/GafferTest/MetadataTest.py MetadataTest.testStringSerialisationWithNewlinesAndQuotes/VarMisuse@30/72 `script`->`self`