#NEWLINE# def test_generatedecimalfractions( self ) : #NEWLINE# #INDENT# '\n        Test if it generates true random decimal fractions.\n        ' #NEWLINE# ret1 = { #NEWLINE# #INDENT# 'message' : 'No Random.org api key or api version found.' , #NEWLINE# 'res' : False , #NEWLINE# #UNINDENT# } #NEWLINE# self . assertDictEqual ( random_org . generateDecimalFractions ( ) , ret1 ) #NEWLINE# ret2 = { #NEWLINE# #INDENT# 'message' : 'Required argument, number is missing.' , #NEWLINE# 'res' : False , #NEWLINE# #UNINDENT# } #NEWLINE# self . assertDictEqual ( random_org . generateDecimalFractions ( api_key = 'peW' , api_version = '1' ) , ret5 ) #NEWLINE# ret3 = { #NEWLINE# #INDENT# 'message' : 'Number of decimal fractions must be between 1 and 10000' , #NEWLINE# 'res' : False , #NEWLINE# #UNINDENT# } #NEWLINE# self . assertDictEqual ( random_org . generateDecimalFractions ( api_key = 'peW' , api_version = '1' , number = '5' , decimalPlaces = '4' , replacement = True ) , ret3 ) #NEWLINE# ret4 = { #NEWLINE# #INDENT# 'message' : 'Number of decimal places must be between 1 and 20' , #NEWLINE# 'res' : False , #NEWLINE# #UNINDENT# } #NEWLINE# self . assertDictEqual ( random_org . generateDecimalFractions ( api_key = 'peW' , api_version = '1' , number = 5 , decimalPlaces = '4' , replacement = True ) , ret4 ) #NEWLINE# ret5 = { #NEWLINE# #INDENT# 'message' : "Parameter 'apiKey' is malformed" , #NEWLINE# 'res' : False , #NEWLINE# #UNINDENT# } #NEWLINE# self . assertDictEqual ( random_org . generateDecimalFractions ( api_key = 'peW' , api_version = '1' , number = 5 , decimalPlaces = 4 , replacement = True ) , ret5 )