#NEWLINE# def testItems( self ) : #NEWLINE# #INDENT# c = GafferUI . ListContainer ( GafferUI . ListContainer . Orientation . Vertical ) #NEWLINE# self . assertEqual ( len ( c ) , 0 ) #NEWLINE# ca = TestWidget ( 'a' ) #NEWLINE# cb = TestWidget ( 'b' ) #NEWLINE# cc = TestWidget ( 'c' ) #NEWLINE# self . assert_ ( ( ca . parent ( ) is None ) ) #NEWLINE# self . assert_ ( ( cb . parent ( ) is None ) ) #NEWLINE# self . assert_ ( ( cc . parent ( ) is None ) ) #NEWLINE# c . append ( ca ) #NEWLINE# self . assertEqual ( len ( c ) , 1 ) #NEWLINE# self . assertEqual ( c [ 0 ] , ca ) #NEWLINE# self . assert_ ( ( ca . parent ( ) is c ) ) #NEWLINE# c . append ( cb ) #NEWLINE# self . assertEqual ( len ( c ) , 2 ) #NEWLINE# self . assertEqual ( c [ 0 ] , ca ) #NEWLINE# self . assertEqual ( c [ 1 ] , cb ) #NEWLINE# self . assert_ ( ( ca . parent ( ) is c ) ) #NEWLINE# self . assert_ ( ( cb . parent ( ) is c ) ) #NEWLINE# c . append ( cc ) #NEWLINE# self . assertEqual ( len ( c ) , 3 ) #NEWLINE# self . assertEqual ( c [ 0 ] , ca ) #NEWLINE# self . assertEqual ( c [ 1 ] , cb ) #NEWLINE# self . assertEqual ( c [ 2 ] , cc ) #NEWLINE# self . assert_ ( ( ca . parent ( ) is c ) ) #NEWLINE# self . assert_ ( ( cb . parent ( ) is c ) ) #NEWLINE# self . assert_ ( ( cc . parent ( ) is c ) ) #NEWLINE# del c [ 0 ] #NEWLINE# self . assertEqual ( len ( c ) , 2 ) #NEWLINE# self . assert_ ( ( ca . parent ( ) is None ) ) #NEWLINE# self . assert_ ( ( cb . parent ( ) is c ) ) #NEWLINE# self . assert_ ( ( cc . parent ( ) is c ) ) #NEWLINE# self . assertEqual ( c [ 0 ] , cb ) #NEWLINE# self . assertEqual ( c [ 1 ] , cc ) #NEWLINE# c . remove ( cc ) #NEWLINE# self . assertEqual ( len ( c ) , 1 ) #NEWLINE# self . assert_ ( ( ca . parent ( ) is None ) ) #NEWLINE# self . assert_ ( ( cb . parent ( ) is c ) ) #NEWLINE# self . assert_ ( ( cc . parent ( ) is None ) ) #NEWLINE# self . assertEqual ( c [ 0 ] , cb )