<s> from helper_helper import * <EOL> from helper_helper import _time <EOL> @ unittest . skipUnless ( os . environ . get ( '<STR_LIT>' , '<STR_LIT:true>' ) . lower ( ) == '<STR_LIT:true>' , '<STR_LIT>' ) <EOL> class ApiHelper ( Chai ) : <EOL> def setUp ( self ) : <EOL> super ( ApiHelper , self ) . setUp ( ) <EOL> self . series = Timeseries ( self . client , type = '<STR_LIT>' , prefix = '<STR_LIT>' , <EOL> read_func = int , <EOL> intervals = { <EOL> '<STR_LIT>' : { <EOL> '<STR_LIT>' : <NUM_LIT> , <EOL> '<STR_LIT>' : <NUM_LIT:5> , <EOL> } , <EOL> '<STR_LIT>' : { <EOL> '<STR_LIT>' : <NUM_LIT> , <EOL> '<STR_LIT>' : <NUM_LIT> , <EOL> } , <EOL> '<STR_LIT>' : { <EOL> '<STR_LIT>' : <NUM_LIT> , <EOL> } <EOL> } ) <EOL> self . series . delete_all ( ) <EOL> def tearDown ( self ) : <EOL> self . series . delete_all ( ) <EOL> def test_list ( self ) : <EOL> self . series . insert ( '<STR_LIT:test>' , <NUM_LIT:32> , timestamp = _time ( <NUM_LIT:0> ) ) <EOL> self . series . insert ( '<STR_LIT>' , <NUM_LIT:32> , timestamp = _time ( <NUM_LIT:0> ) ) <EOL> self . series . insert ( '<STR_LIT>' , <NUM_LIT:32> , timestamp = _time ( <NUM_LIT:0> ) ) <EOL> self . series . insert ( '<STR_LIT:test>' , <NUM_LIT:32> , timestamp = _time ( <NUM_LIT:0> ) ) <EOL> res = sorted ( self . series . list ( ) ) <EOL> assert_equals ( [ '<STR_LIT:test>' , '<STR_LIT>' , '<STR_LIT>' ] , res ) <EOL> self . series . delete ( '<STR_LIT:test>' ) <EOL> self . series . delete ( '<STR_LIT>' ) <EOL> self . series . delete ( '<STR_LIT>' ) <EOL> def test_properties ( self ) : <EOL> self . series . insert ( '<STR_LIT:test>' , <NUM_LIT:32> , timestamp = _time ( <NUM_LIT:0> ) ) <EOL> self . series . insert ( '<STR_LIT:test>' , <NUM_LIT:32> , timestamp = _time ( <NUM_LIT> ) ) <EOL> self . series . insert ( '<STR_LIT:test>' , <NUM_LIT:32> , timestamp = _time ( <NUM_LIT> ) ) <EOL> res = self . series . properties ( '<STR_LIT:test>' ) <EOL> assert_equals ( _time ( <NUM_LIT:0> ) , res [ '<STR_LIT>' ] [ '<STR_LIT>' ] ) <EOL> assert_equals ( _time ( <NUM_LIT> ) , res [ '<STR_LIT>' ] [ '<STR_LIT>' ] ) <EOL> assert_equals ( _time ( <NUM_LIT:0> ) , res [ '<STR_LIT>' ] [ '<STR_LIT>' ] ) <EOL> assert_equals ( _time ( <NUM_LIT:0> ) , res [ '<STR_LIT>' ] [ '<STR_LIT>' ] ) <EOL> self . series . delete ( '<STR_LIT:test>' ) <EOL> def test_iterate ( self ) : <EOL> self . series . insert ( '<STR_LIT:test>' , <NUM_LIT:32> , timestamp = _time ( <NUM_LIT:0> ) ) <EOL> self . series . insert ( '<STR_LIT:test>' , <NUM_LIT> , timestamp = _time ( <NUM_LIT> ) ) <EOL> self . series . insert ( '<STR_LIT:test>' , <NUM_LIT> , timestamp = _time ( <NUM_LIT> ) ) <EOL> res = list ( self . series . iterate ( '<STR_LIT:test>' , '<STR_LIT>' ) ) <EOL> assert_equals ( <NUM_LIT:11> , len ( res ) ) <EOL> assert_equals ( ( _time ( <NUM_LIT:0> ) , [ <NUM_LIT:32> ] ) , res [ <NUM_LIT:0> ] ) <EOL> assert_equals ( ( _time ( <NUM_LIT> ) , [ <NUM_LIT> ] ) , res [ <NUM_LIT:1> ] ) <EOL> assert_equals ( ( _time ( <NUM_LIT> ) , [ ] ) , res [ <NUM_LIT:2> ] ) <EOL> assert_equals ( ( _time ( <NUM_LIT> ) , [ <NUM_LIT> ] ) , res [ - <NUM_LIT:1> ] ) <EOL> res = list ( self . series . iterate ( '<STR_LIT:test>' , '<STR_LIT>' ) ) <EOL> assert_equals ( <NUM_LIT:3> , len ( res ) ) <EOL> assert_equals ( ( _time ( <NUM_LIT:0> ) , [ <NUM_LIT:32> ] ) , res [ <NUM_LIT:0> ] ) <EOL> assert_equals ( ( _time ( <NUM_LIT> ) , [ <NUM_LIT> ] ) , res [ <NUM_LIT:1> ] ) <EOL> assert_equals ( ( _time ( <NUM_LIT> ) , [ <NUM_LIT> ] ) , res [ <NUM_LIT:2> ] ) <EOL> res = list ( self . series . iterate ( '<STR_LIT:test>' , '<STR_LIT>' ) ) <EOL> assert_equals ( <NUM_LIT:1> , len ( res ) ) <EOL> assert_equals ( ( _time ( <NUM_LIT:0> ) , [ <NUM_LIT:32> , <NUM_LIT> , <NUM_LIT> ] ) , res [ <NUM_LIT:0> ] ) <EOL> self . series . delete ( '<STR_LIT:test>' ) </s>
