#NEWLINE# def test_wrong_nesting( self ) : #NEWLINE# #INDENT# correct = [ 'A' , { #NEWLINE# #INDENT# 'name' : 'B' , #NEWLINE# 'children' : self . stuff . machine , #NEWLINE# #UNINDENT# } ] #NEWLINE# wrong_type = [ 'A' , { #NEWLINE# #INDENT# 'name' : 'B' , #NEWLINE# 'children' : self . stuff , #NEWLINE# #UNINDENT# } ] #NEWLINE# siblings = [ 'A' , { #NEWLINE# #INDENT# 'name' : 'B' , #NEWLINE# 'children' : [ '1' , self . stuff . machine ] , #NEWLINE# #UNINDENT# } ] #NEWLINE# collision = [ 'A' , { #NEWLINE# #INDENT# 'name' : 'B' , #NEWLINE# 'children' : [ 'A' , self . stuff . machine ] , #NEWLINE# #UNINDENT# } ] #NEWLINE# m = Machine ( None , states = correct ) #NEWLINE# if ( State . separator in '_' ) : #NEWLINE# #INDENT# m . to_B_C_3_a ( ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# m . to_B . C . s3 . a ( ) #NEWLINE# #UNINDENT# with self . assertRaises ( ValueError ) : #NEWLINE# #INDENT# m = Machine ( None , states = wrong_type ) #NEWLINE# #UNINDENT# with self . assertRaises ( ValueError ) : #NEWLINE# #INDENT# m = Machine ( None , states = collision ) #NEWLINE# #UNINDENT# m = Machine ( None , states = m ) #NEWLINE# if ( State . separator in '_' ) : #NEWLINE# #INDENT# m . to_B_1 ( ) #NEWLINE# m . to_B_A ( ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# m . to_B . s1 ( ) #NEWLINE# m . to_B . A ( )