#NEWLINE# def test_speed_test_cached( self ) : #NEWLINE# #INDENT# cache_path = os . path . join ( os . getcwd ( ) , 'speed_test' ) #NEWLINE# if os . path . exists ( cache_path ) : #NEWLINE# #INDENT# os . remove ( cache_path ) #NEWLINE# #UNINDENT# content = '{"download": 1, "upload": 2}' #NEWLINE# with open ( cache_path , 'w' ) as fp : #NEWLINE# #INDENT# fp . write ( content ) #NEWLINE# #UNINDENT# ret = bt . speed_test_cached ( ) #NEWLINE# self . assertTrue ( ( ret [ 'download' ] == 1 ) ) #NEWLINE# self . assertTrue ( ( ret [ 'upload' ] == 2 ) )