#NEWLINE# def test_get_admin_info_invalid_path( self ) : #NEWLINE# #INDENT# controller = self . get_controller ( expose_info = True , admin_key = 'secret-admin-key' ) #NEWLINE# utils . _swift_info = { #NEWLINE# #INDENT# 'foo' : { #NEWLINE# #INDENT# 'bar' : 'baz' , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } #NEWLINE# utils . _swift_admin_info = { #NEWLINE# #INDENT# 'qux' : { #NEWLINE# #INDENT# 'quux' : 'corge' , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } #NEWLINE# expires = int ( ( time . time ( ) + 86400 ) ) #NEWLINE# sig = utils . get_hmac ( 'GET' , '/foo' , expires , 'secret-admin-key' ) #NEWLINE# path = '/info?swiftinfo_sig={sig}&swiftinfo_expires={expires}' . format ( sig = sig , expires = expires ) #NEWLINE# req = Request . blank ( path , environ = { #NEWLINE# #INDENT# 'REQUEST_METHOD' : 'GET' , #NEWLINE# #UNINDENT# } ) #NEWLINE# resp = controller . GET ( req ) #NEWLINE# self . assertTrue ( isinstance ( resp , HTTPException ) ) #NEWLINE# self . assertEqual ( '401 Unauthorized' , str ( resp ) )