#NEWLINE# def _gen_context( self , tenants_count , users_per_tenant , resources_per_tenant , samples_per_resource ) : #NEWLINE# #INDENT# tenants = self . _gen_tenants ( tenants_count ) #NEWLINE# users = [ ] #NEWLINE# for id_ in tenants . keys ( ) : #NEWLINE# #INDENT# for i in range ( users_per_tenant ) : #NEWLINE# #INDENT# users . append ( { #NEWLINE# #INDENT# 'id' : i , #NEWLINE# 'tenant_id' : id_ , #NEWLINE# 'credential' : mock . MagicMock ( ) , #NEWLINE# #UNINDENT# } ) #NEWLINE# #UNINDENT# #UNINDENT# context = test . get_test_context ( ) #NEWLINE# context . update ( { #NEWLINE# #INDENT# 'config' : { #NEWLINE# #INDENT# 'users' : { #NEWLINE# #INDENT# 'tenants' : tenants_count , #NEWLINE# 'users_per_tenant' : users_per_tenant , #NEWLINE# 'concurrent' : 10 , #NEWLINE# #UNINDENT# } , #NEWLINE# 'ceilometer' : { #NEWLINE# #INDENT# 'counter_name' : 'fake-counter-name' , #NEWLINE# 'counter_type' : 'fake-counter-type' , #NEWLINE# 'counter_unit' : 'fake-counter-unit' , #NEWLINE# 'counter_volume' : 100 , #NEWLINE# 'resources_per_tenant' : resources_per_tenant , #NEWLINE# 'samples_per_resource' : samples_per_resource , #NEWLINE# 'timestamp_interval' : 60 , #NEWLINE# 'metadata_list' : [ { #NEWLINE# #INDENT# 'status' : 'active' , #NEWLINE# 'name' : 'fake_resource' , #NEWLINE# 'deleted' : 'False' , #NEWLINE# 'created_at' : '2015-09-04T12:34:19.000000' , #NEWLINE# #UNINDENT# } , { #NEWLINE# #INDENT# 'status' : 'not_active' , #NEWLINE# 'name' : 'fake_resource_1' , #NEWLINE# 'deleted' : 'False' , #NEWLINE# 'created_at' : '2015-09-10T06:55:12.000000' , #NEWLINE# #UNINDENT# } ] , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } , #NEWLINE# 'admin' : { #NEWLINE# #INDENT# 'credential' : mock . MagicMock ( ) , #NEWLINE# #UNINDENT# } , #NEWLINE# 'users' : users , #NEWLINE# 'tenants' : tenants , #NEWLINE# #UNINDENT# } ) #NEWLINE# return ( tenants , context )