#NEWLINE# def testParentChanges( self ) : #NEWLINE# #INDENT# n1 = Gaffer . Node ( 'n1' ) #NEWLINE# n2 = Gaffer . Node ( 'n2' ) #NEWLINE# p1 = Gaffer . CompoundPlug ( 'p1' ) #NEWLINE# p2 = Gaffer . Plug ( 'p2' ) #NEWLINE# l = GafferUI . NameLabel ( p2 , numComponents = 3 ) #NEWLINE# self . assertEqual ( l . getText ( ) , 'P2' ) #NEWLINE# p1 . addChild ( p2 ) #NEWLINE# self . assertEqual ( l . getText ( ) , 'P1.P2' ) #NEWLINE# p1 . setName ( 'B' ) #NEWLINE# self . assertEqual ( l . getText ( ) , 'B.P2' ) #NEWLINE# p2 . setName ( 'C' ) #NEWLINE# self . assertEqual ( l . getText ( ) , 'B.C' ) #NEWLINE# n2 . addChild ( p1 ) #NEWLINE# self . assertEqual ( l . getText ( ) , 'N2.B.C' ) #NEWLINE# n1 . addChild ( n2 ) #NEWLINE# self . assertEqual ( l . getText ( ) , 'N2.B.C' ) #NEWLINE# n2 . setName ( 'A' ) #NEWLINE# self . assertEqual ( l . getText ( ) , 'A.B.C' ) #NEWLINE# n1 . addChild ( p1 ) #NEWLINE# self . assertEqual ( l . getText ( ) , 'N1.B.C' ) #NEWLINE# n1 . addChild ( p2 ) #NEWLINE# self . assertEqual ( l . getText ( ) , 'N1.C' ) #NEWLINE# n1 . setName ( 'AAA' ) #NEWLINE# p2 . setName ( 'BBB' ) #NEWLINE# self . assertEqual ( l . getText ( ) , 'AAA.BBB' )