#NEWLINE# def test_get( self ) : #NEWLINE# #INDENT# for t in xrange ( 1 , 7200 ) : #NEWLINE# #INDENT# self . series . insert ( 'test' , 1 , timestamp = _time ( self ) ) #NEWLINE# #UNINDENT# interval = self . series . get ( 'test' , 'minute' , timestamp = _time ( 100 ) ) #NEWLINE# assert_equals ( map ( _time , [ 60 ] ) , interval . keys ( ) ) #NEWLINE# assert_equals ( 60 , interval [ _time ( 60 ) ] ) #NEWLINE# interval = self . series . get ( 'test' , 'minute' ) #NEWLINE# assert_equals ( 1 , len ( interval ) ) #NEWLINE# assert_equals ( 0 , interval . values ( ) [ 0 ] ) #NEWLINE# interval = self . series . get ( 'test' , 'hour' , timestamp = _time ( 100 ) ) #NEWLINE# assert_equals ( 60 , len ( interval ) ) #NEWLINE# assert_equals ( 60 , interval [ _time ( 60 ) ] ) #NEWLINE# interval = self . series . get ( 'test' , 'hour' , timestamp = _time ( 100 ) , transform = 'rate' ) #NEWLINE# assert_equals ( 1.0 , interval [ _time ( 60 ) ] ) #NEWLINE# interval = self . series . get ( 'test' , 'hour' , timestamp = _time ( 100 ) , condensed = True ) #NEWLINE# assert_equals ( 1 , len ( interval ) ) #NEWLINE# assert_equals ( 3599 , interval [ _time ( 0 ) ] ) #NEWLINE# interval = self . series . get ( 'test' , 'hour' , timestamp = _time ( 4000 ) , condensed = True ) #NEWLINE# assert_equals ( 1 , len ( interval ) ) #NEWLINE# assert_equals ( 3600 , interval [ _time ( 3600 ) ] ) #NEWLINE# interval = self . series . get ( 'test' , 'hour' , timestamp = _time ( 4000 ) , condensed = True , transform = 'rate' ) #NEWLINE# assert_equals ( 1 , len ( interval ) ) #NEWLINE# assert_equals ( 1.0 , interval [ _time ( 3600 ) ] )