#NEWLINE# def test_archive_skip( self ) : #NEWLINE# #INDENT# 'Test that the archive method skips new entries' #NEWLINE# self . r . hset ( self . counter , ( self . start_time - 1 ) , 1 ) #NEWLINE# self . r . hset ( self . counter , ( self . start_time + 1 ) , 2 ) #NEWLINE# TimeSeries . archive_cat_counts ( self . r , self . cat_id , self . start_time ) #NEWLINE# self . assertRaises ( KeyError , self . r . hget , self . counter , ( self . start_time - 1 ) ) #NEWLINE# self . assertTrue ( self . r . hget ( self . counter , ( self . start_time + 1 ) ) ) #NEWLINE# ts = self . r . zrange ( ( 'ts_%s' % self . cat_id ) , 0 , ( - 1 ) , withscores = True ) #NEWLINE# self . assertEqual ( len ( ts ) , 1 ) #NEWLINE# self . assertEqual ( ts_to_hits ( ts [ 0 ] ) , 1 )