<s> import unittest <EOL> import IECore <EOL> import Gaffer <EOL> import GafferTest <EOL> class GraphComponentPathTest ( GafferTest . TestCase ) : <EOL> def testRelative ( self ) : <EOL> r = Gaffer . GraphComponent ( ) <EOL> r [ "<STR_LIT:d>" ] = Gaffer . GraphComponent ( ) <EOL> r [ "<STR_LIT:d>" ] [ "<STR_LIT:e>" ] = Gaffer . GraphComponent ( ) <EOL> p = Gaffer . GraphComponentPath ( r , "<STR_LIT:d>" ) <EOL> self . assertEqual ( str ( p ) , "<STR_LIT:d>" ) <EOL> self . assertEqual ( p . root ( ) , "<STR_LIT>" ) <EOL> self . assertEqual ( [ str ( c ) for c in p . children ( ) ] , [ "<STR_LIT>" ] ) <EOL> p2 = p . copy ( ) <EOL> self . assertEqual ( str ( p2 ) , "<STR_LIT:d>" ) <EOL> self . assertEqual ( p2 . root ( ) , "<STR_LIT>" ) <EOL> self . assertEqual ( [ str ( c ) for c in p2 . children ( ) ] , [ "<STR_LIT>" ] ) <EOL> def testProperties ( self ) : <EOL> r = Gaffer . GraphComponent ( ) <EOL> r [ "<STR_LIT:d>" ] = Gaffer . GraphComponent ( ) <EOL> p = Gaffer . GraphComponentPath ( r , "<STR_LIT>" ) <EOL> self . assertEqual ( p . propertyNames ( ) , [ "<STR_LIT:name>" , "<STR_LIT>" ] ) <EOL> self . assertEqual ( p . property ( "<STR_LIT:name>" ) , "<STR_LIT:d>" ) <EOL> self . assertEqual ( p . property ( "<STR_LIT>" ) , "<STR_LIT>" ) <EOL> if __name__ == "<STR_LIT:__main__>" : <EOL> unittest . main ( ) </s>
