#NEWLINE# @ qc #NEWLINE# def get_host_cpu_mhz( cpu_mhz = int_ ( min = 1 , max = 1000 ) , prev_total = float_ ( min = 100 , max = 1000 ) , prev_busy = float_ ( min = 1 , max = 100 ) , diff_total = float_ ( min = 100 , max = 1000 ) , diff_busy = float_ ( min = 1 , max = 100 ) ) : #NEWLINE# #INDENT# with MockTransaction : #NEWLINE# #INDENT# total = ( prev_total + diff_total ) #NEWLINE# busy = ( prev_busy + diff_busy ) #NEWLINE# expect ( collector ) . get_host_cpu_time ( ) . and_return ( ( total , busy ) ) . once ( ) #NEWLINE# assert ( collector . get_host_cpu_mhz ( cpu_mhz , prev_total , prev_busy ) == ( total , diff_total , int ( ( ( cpu_mhz * diff_busy ) / diff_total ) ) ) )