#NEWLINE# def test_save_all( self ) : #NEWLINE# #INDENT# models = self . mapper #NEWLINE# with models . session ( ) . begin ( ) as t : #NEWLINE# #INDENT# for o in self . observables : #NEWLINE# #INDENT# t . add ( o ) #NEWLINE# #UNINDENT# #UNINDENT# ( yield t . on_result ) #NEWLINE# now = time ( ) #NEWLINE# updates = ( yield models . observer . updates . size ( ) ) #NEWLINE# self . assertEqual ( updates , self . data . observers ) #NEWLINE# data = ( yield models . observer . updates . irange ( ) ) #NEWLINE# self . assertEqual ( len ( data ) , self . data . observers ) #NEWLINE# penalty = models . observer . updates . penalty #NEWLINE# prev = None #NEWLINE# observers = dict ( ( ( o . id , o ) for o in self . observers ) ) #NEWLINE# for ( score , id ) in data : #NEWLINE# #INDENT# observer = observers [ id ] #NEWLINE# N = ( yield observer . underlyings . query ( ) . count ( ) ) #NEWLINE# if prev : #NEWLINE# #INDENT# self . assertTrue ( ( N <= prev ) ) #NEWLINE# #UNINDENT# prev = N