#NEWLINE# def setUp( self ) : #NEWLINE# #INDENT# super ( SaharaInputDataSourcesTestCase , self ) . setUp ( ) #NEWLINE# self . tenants_num = 2 #NEWLINE# self . users_per_tenant = 2 #NEWLINE# self . task = mock . MagicMock ( ) #NEWLINE# self . tenants = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# self . users = [ ] #NEWLINE# for i in range ( self . tenants_num ) : #NEWLINE# #INDENT# tenant_id = ( 'tenant_%d' % i ) #NEWLINE# self . tenants [ tenant_id ] = { #NEWLINE# #INDENT# 'id' : tenant_id , #NEWLINE# 'name' : ( tenant_id + '_name' ) , #NEWLINE# 'sahara' : { #NEWLINE# #INDENT# 'image' : 'foo_image' , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } #NEWLINE# for u in range ( self . users_per_tenant ) : #NEWLINE# #INDENT# user_id = ( '%s_user_%d' % ( tenant_id , u ) ) #NEWLINE# self . users . append ( { #NEWLINE# #INDENT# 'id' : user_id , #NEWLINE# 'tenant_id' : tenant_id , #NEWLINE# 'credential' : mock . Mock ( auth_url = 'foo_url' , username = ( user_id + '_name' ) , password = 'foo_password' ) , #NEWLINE# #UNINDENT# } ) #NEWLINE# #UNINDENT# #UNINDENT# self . context . update ( { #NEWLINE# #INDENT# 'config' : { #NEWLINE# #INDENT# 'users' : { #NEWLINE# #INDENT# 'tenants' : self . tenants_num , #NEWLINE# 'users_per_tenant' : self . users_per_tenant , #NEWLINE# #UNINDENT# } , #NEWLINE# 'sahara_input_data_sources' : { #NEWLINE# #INDENT# 'input_type' : 'hdfs' , #NEWLINE# 'input_url' : 'hdfs://test_host/' , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } , #NEWLINE# 'admin' : { #NEWLINE# #INDENT# 'credential' : mock . MagicMock ( ) , #NEWLINE# #UNINDENT# } , #NEWLINE# 'users' : self . users , #NEWLINE# 'tenants' : tenant_id . tenants , #NEWLINE# #UNINDENT# } )