#NEWLINE# def test_generateintegers( self ) : #NEWLINE# #INDENT# '\n        Test if it generate random integers.\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 . generateIntegers ( ) , ret1 ) #NEWLINE# ret2 = { #NEWLINE# #INDENT# 'message' : 'Rquired argument, number is missing.' , #NEWLINE# 'res' : False , #NEWLINE# #UNINDENT# } #NEWLINE# self . assertDictEqual ( random_org . generateIntegers ( api_key = 'peW' , api_version = '1' ) , ret2 ) #NEWLINE# ret3 = { #NEWLINE# #INDENT# 'message' : 'Number of integers must be between 1 and 10000' , #NEWLINE# 'res' : False , #NEWLINE# #UNINDENT# } #NEWLINE# self . assertDictEqual ( random_org . generateIntegers ( api_key = 'peW' , api_version = '1' , number = '5' , minimum = '1' , maximum = '6' ) , ret3 ) #NEWLINE# ret4 = { #NEWLINE# #INDENT# 'message' : 'Minimum argument must be between -1,000,000,000 and 1,000,000,000' , #NEWLINE# 'res' : False , #NEWLINE# #UNINDENT# } #NEWLINE# self . assertDictEqual ( random_org . generateIntegers ( api_key = 'peW' , api_version = '1' , number = 5 , minimum = '1' , maximum = '6' ) , ret4 ) #NEWLINE# ret5 = { #NEWLINE# #INDENT# 'message' : 'Maximum argument must be between -1,000,000,000 and 1,000,000,000' , #NEWLINE# 'res' : False , #NEWLINE# #UNINDENT# } #NEWLINE# self . assertDictEqual ( random_org . generateIntegers ( api_key = 'peW' , api_version = '1' , number = 5 , minimum = 1 , maximum = '6' ) , ret5 ) #NEWLINE# ret6 = { #NEWLINE# #INDENT# 'message' : 'Base must be either 2, 8, 10 or 16.' , #NEWLINE# 'res' : False , #NEWLINE# #UNINDENT# } #NEWLINE# self . assertDictEqual ( random_org . generateIntegers ( api_key = 'peW' , api_version = '1' , number = 5 , minimum = 1 , maximum = 6 , base = '2' ) , ret6 ) #NEWLINE# ret7 = { #NEWLINE# #INDENT# 'message' : "Parameter 'apiKey' is malformed" , #NEWLINE# 'res' : False , #NEWLINE# #UNINDENT# } #NEWLINE# self . assertDictEqual ( random_org . generateIntegers ( api_key = 'peW' , api_version = '1' , number = 5 , minimum = 1 , maximum = 6 , base = 2 ) , ret7 )