#NEWLINE# def test_get_rendered_speed( self ) : #NEWLINE# #INDENT# B = 1 #NEWLINE# KB = ( B * 1024 ) #NEWLINE# MB = ( KB * 1024 ) #NEWLINE# GB = ( MB * 1024 ) #NEWLINE# bar = ProgressBar ( KB ) #NEWLINE# self . assertEqual ( bar . get_rendered_speed ( 512 , 1 ) , 'Speed: 512 B/s' ) #NEWLINE# self . assertEqual ( bar . get_rendered_speed ( 512 , 2 ) , 'Speed: 256 B/s' ) #NEWLINE# self . assertEqual ( bar . get_rendered_speed ( 900 , 3 ) , 'Speed: 300 B/s' ) #NEWLINE# bar = ProgressBar ( ( GB * 10 ) ) #NEWLINE# self . assertEqual ( bar . get_rendered_speed ( KB , 1 ) , 'Speed: 1 KB/s' ) #NEWLINE# self . assertEqual ( bar . get_rendered_speed ( MB , 1 ) , 'Speed: 1.0 MB/s' ) #NEWLINE# self . assertEqual ( bar . get_rendered_speed ( ( GB * 4 ) , 2 ) , 'Speed: 2.00 GB/s' ) #NEWLINE# self . assertEqual ( bar . get_rendered_speed ( ( GB * 5 ) , 2 ) , 'Speed: 2.50 GB/s' )