#NEWLINE# @ gen_test #NEWLINE# def test_connections_unacknowledged_writes( self ) : #NEWLINE# #INDENT# collection = self . cx . motor_test . test_collection #NEWLINE# ( yield collection . drop ( ) ) #NEWLINE# pool = self . cx . _get_primary_pool ( ) #NEWLINE# self . assertEqual ( 1 , pool . motor_sock_counter ) #NEWLINE# nops = 10 #NEWLINE# for i in range ( ( nops - 1 ) ) : #NEWLINE# #INDENT# collection . insert ( { #NEWLINE# #INDENT# '_id' : i , #NEWLINE# #UNINDENT# } , w = 0 ) #NEWLINE# self . assertEqual ( 1 , pool . motor_sock_counter ) #NEWLINE# self . assertEqual ( 1 , len ( pool . sockets ) ) #NEWLINE# #UNINDENT# ( yield collection . insert ( { #NEWLINE# #INDENT# '_id' : ( nops - 1 ) , #NEWLINE# #UNINDENT# } ) ) #NEWLINE# self . assertEqual ( 1 , pool . motor_sock_counter ) #NEWLINE# self . assertEqual ( 1 , len ( pool . sockets ) ) #NEWLINE# docs = ( yield collection . find ( ) . sort ( '_id' ) . to_list ( length = 100 ) ) #NEWLINE# self . assertEqual ( list ( range ( nops ) ) , [ doc [ '_id' ] for doc in docs ] )