#NEWLINE# @ skipIf ( version_2_1 , 'this test highlights a server bug in 2.1' ) #NEWLINE# def test_will_fail_batch_if_more_than_one_exists( self ) : #NEWLINE# #INDENT# self . batch . create ( { #NEWLINE# #INDENT# 'name' : 'Alice' , #NEWLINE# #UNINDENT# } ) #NEWLINE# self . batch . create ( { #NEWLINE# #INDENT# 'name' : 'Bob' , #NEWLINE# #UNINDENT# } ) #NEWLINE# self . batch . create ( ( 0 , 'KNOWS' , 1 ) ) #NEWLINE# self . batch . create ( ( 0 , 'KNOWS' , 1 ) ) #NEWLINE# ( alice , bob , k1 , k2 ) = self . batch . run ( ) #NEWLINE# self . batch . jobs = [ ] #NEWLINE# self . batch . get_or_create_path ( alice , 'KNOWS' , bob ) #NEWLINE# with self . assertRaises ( BatchError ) as error : #NEWLINE# #INDENT# self . batch . run ( ) #NEWLINE# #UNINDENT# cause = cause . exception . __cause__ #NEWLINE# assert isinstance ( cause , ConstraintError )