#NEWLINE# def test_load_paste_app_with_conf_name( self ) : #NEWLINE# #INDENT# def fake_join( * args ) : #NEWLINE# #INDENT# if ( ( len ( args ) == 2 ) and args [ 0 ] . endswith ( '.glance' ) and ( args [ 1 ] == 'glance-cache.conf' ) ) : #NEWLINE# #INDENT# return os . path . join ( os . getcwd ( ) , 'etc' , args [ 1 ] ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return orig_join ( * args ) #NEWLINE# #UNINDENT# #UNINDENT# orig_join = os . path . join #NEWLINE# self . stubs . Set ( os . path , 'join' , fake_join ) #NEWLINE# conf = config . GlanceCacheConfigOpts ( ) #NEWLINE# conf ( [ ] ) #NEWLINE# self . stubs . Set ( config , 'setup_logging' , ( lambda * a : None ) ) #NEWLINE# self . stubs . Set ( pruner , 'Pruner' , ( lambda conf , **lc : 'pruner' ) ) #NEWLINE# app = config . load_paste_app ( conf , 'glance-pruner' ) #NEWLINE# self . assertEquals ( 'pruner' , app )