#NEWLINE# @ qc ( 10 ) #NEWLINE# def start( iterations = int_ ( min = 0 , max = 10 ) , time_interval = int_ ( min = 0 ) ) : #NEWLINE# #INDENT# with MockTransaction : #NEWLINE# #INDENT# state = { #NEWLINE# #INDENT# 'property' : 'value' , #NEWLINE# #UNINDENT# } #NEWLINE# config = { #NEWLINE# #INDENT# 'log_directory' : 'dir' , #NEWLINE# 'log_level' : 2 , #NEWLINE# 'local_data_directory' : 'data_dir' , #NEWLINE# 'data_collector_interval' : str ( time_interval ) , #NEWLINE# #UNINDENT# } #NEWLINE# paths = [ collector . DEFAILT_CONFIG_PATH , collector . CONFIG_PATH ] #NEWLINE# fields = collector . REQUIRED_FIELDS #NEWLINE# expect ( collector ) . read_and_validate_config ( paths , fields ) . and_return ( config ) . once ( ) #NEWLINE# expect ( common ) . init_logging ( 'dir' , 'data-collector.log' , 2 ) . once ( ) #NEWLINE# expect ( common ) . start ( collector . init_state , collector . execute , config , time_interval ) . and_return ( state ) . once ( ) #NEWLINE# assert ( collector . start ( ) == state )