#NEWLINE# @ qc #NEWLINE# def append_host_data_locally( data = list_ ( of = int_ ( min = 0 , max = 3000 ) , min_length = 0 , max_length = 10 ) , x = int_ ( min = 0 , max = 3000 ) , data_length = int_ ( min = 0 , max = 10 ) ) : #NEWLINE# #INDENT# path = os . path . join ( os . path . dirname ( __file__ ) , '..' , 'resources' , 'host' ) #NEWLINE# with open ( path , 'w' ) as f : #NEWLINE# #INDENT# f . write ( ( '\n' . join ( [ str ( x ) for x in data ] ) + '\n' ) ) #NEWLINE# #UNINDENT# collector . append_host_data_locally ( path , x , data_length ) #NEWLINE# if ( data_length > 0 ) : #NEWLINE# #INDENT# data . append ( x ) #NEWLINE# expected = data [ ( - data_length ) : ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# expected = [ ] #NEWLINE# #UNINDENT# with open ( path , 'r' ) as f : #NEWLINE# #INDENT# actual = [ int ( x ) for x in f . read ( ) . strip ( ) . splitlines ( ) ] #NEWLINE# #UNINDENT# os . remove ( path ) #NEWLINE# assert ( actual == expected )