#NEWLINE# def test_delete_single_version_success( self ) : #NEWLINE# #INDENT# self . app . register ( 'DELETE' , '/v1/a/c/o' , swob . HTTPOk , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } , 'passed' ) #NEWLINE# self . app . register ( 'GET' , '/v1/a/ver_cont?format=json&prefix=001o/&marker=&reverse=on' , swob . HTTPOk , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } , '[{"hash": "y", "last_modified": "2014-11-21T14:23:02.206740", "bytes": 3, "name": "001o/1", "content_type": "text/plain"}]' ) #NEWLINE# self . app . register ( 'GET' , '/v1/a/ver_cont/001o/1' , swob . HTTPOk , { #NEWLINE# #INDENT# 'content-length' : '3' , #NEWLINE# #UNINDENT# } , None ) #NEWLINE# self . app . register ( 'PUT' , '/v1/a/c/o' , swob . HTTPCreated , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } , None ) #NEWLINE# self . app . register ( 'DELETE' , '/v1/a/ver_cont/001o/1' , swob . HTTPOk , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } , None ) #NEWLINE# cache = FakeCache ( { #NEWLINE# #INDENT# 'sysmeta' : { #NEWLINE# #INDENT# 'versions-location' : 'ver_cont' , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } ) #NEWLINE# req = Request . blank ( '/v1/a/c/o' , environ = { #NEWLINE# #INDENT# 'REQUEST_METHOD' : 'DELETE' , #NEWLINE# 'swift.cache' : cache , #NEWLINE# 'CONTENT_LENGTH' : '0' , #NEWLINE# #UNINDENT# } ) #NEWLINE# ( status , headers , body ) = self . call_vw ( req ) #NEWLINE# self . assertEqual ( status , '200 OK' ) #NEWLINE# self . assertEqual ( len ( self . authorized ) , 1 ) #NEWLINE# self . assertRequestEqual ( req , self . authorized [ 0 ] ) #NEWLINE# prefix_listing_prefix = '/v1/a/ver_cont?format=json&prefix=001o/&' #NEWLINE# self . assertEqual ( self . app . calls , [ ( 'GET' , ( cache + 'marker=&reverse=on' ) ) , ( 'GET' , '/v1/a/ver_cont/001o/1' ) , ( 'PUT' , '/v1/a/c/o' ) , ( 'DELETE' , '/v1/a/ver_cont/001o/1' ) ] )