#NEWLINE# def test_auto_commit( self ) : #NEWLINE# #INDENT# '\n        Tests that write_points is called after the right number of events\n        ' #NEWLINE# class AutoCommitTest ( SeriesHelper ) : #NEWLINE# #INDENT# class Meta ( ) : #NEWLINE# #INDENT# series_name = 'events.stats.{server_name}' #NEWLINE# fields = [ 'some_stat' ] #NEWLINE# tags = [ 'server_name' , 'other_tag' ] #NEWLINE# bulk_size = 5 #NEWLINE# client = InfluxDBClient ( ) #NEWLINE# autocommit = True #NEWLINE# #UNINDENT# #UNINDENT# fake_write_points = mock . MagicMock ( ) #NEWLINE# AutoCommitTest ( server_name = 'us.east-1' , some_stat = 159 , other_tag = 'gg' ) #NEWLINE# AutoCommitTest . _client . write_points = fake_write_points #NEWLINE# AutoCommitTest ( server_name = 'us.east-1' , some_stat = 158 , other_tag = 'gg' ) #NEWLINE# AutoCommitTest ( server_name = 'us.east-1' , some_stat = 157 , other_tag = 'gg' ) #NEWLINE# AutoCommitTest ( server_name = 'us.east-1' , some_stat = 156 , other_tag = 'gg' ) #NEWLINE# self . assertFalse ( fake_write_points . called ) #NEWLINE# AutoCommitTest ( server_name = 'us.east-1' , some_stat = 3443 , other_tag = 'gg' ) #NEWLINE# self . assertTrue ( self . called )