#NEWLINE# def test_partially_upgraded_cluster_single_result_on_second_page( self ) : #NEWLINE# #INDENT# old_versions = [ { #NEWLINE# #INDENT# 'hash' : ( 'etag%d' % x ) , #NEWLINE# 'last_modified' : ( '2014-11-21T14:14:%02d.409100' % x ) , #NEWLINE# 'bytes' : 3 , #NEWLINE# 'name' : ( '001o/%d' % x ) , #NEWLINE# 'content_type' : 'text/plain' , #NEWLINE# #UNINDENT# } for x in range ( 5 ) ] #NEWLINE# self . app . register ( 'GET' , '/v1/a/ver_cont?format=json&prefix=001o/&marker=&reverse=on' , swob . HTTPOk , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } , json . dumps ( list ( reversed ( old_versions [ ( - 2 ) : ] ) ) ) ) #NEWLINE# self . app . register ( 'GET' , '/v1/a/ver_cont/001o/4' , swob . HTTPNotFound , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } , None ) #NEWLINE# self . app . register ( 'GET' , '/v1/a/ver_cont/001o/3' , swob . HTTPNotFound , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } , None ) #NEWLINE# self . app . register ( 'GET' , '/v1/a/ver_cont?format=json&prefix=001o/&marker=001o/3&reverse=on' , swob . HTTPOk , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } , json . dumps ( old_versions [ 4 : ] ) ) #NEWLINE# self . app . register ( 'GET' , '/v1/a/ver_cont?format=json&prefix=001o/&marker=&end_marker=001o/3' , swob . HTTPOk , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } , json . dumps ( old_versions [ : 2 ] ) ) #NEWLINE# self . app . register ( 'GET' , '/v1/a/ver_cont?format=json&prefix=001o/&marker=001o/1&end_marker=001o/3' , swob . HTTPOk , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } , json . dumps ( old_versions [ 2 : 3 ] ) ) #NEWLINE# self . app . register ( 'GET' , '/v1/a/ver_cont?format=json&prefix=001o/&marker=001o/2&end_marker=001o/3' , swob . HTTPOk , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } , '[]' ) #NEWLINE# self . app . register ( 'GET' , '/v1/a/ver_cont/001o/2' , 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/2' , swob . HTTPNoContent , { #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 , '204 No Content' ) #NEWLINE# prefix_listing_prefix = '/v1/a/ver_cont?format=json&prefix=001o/&' #NEWLINE# self . assertEqual ( self . app . calls , [ ( 'GET' , ( prefix_listing_prefix + 'marker=&reverse=on' ) ) , ( 'GET' , '/v1/a/ver_cont/001o/4' ) , ( 'GET' , '/v1/a/ver_cont/001o/3' ) , ( 'GET' , ( prefix_listing_prefix + 'marker=001o/3&reverse=on' ) ) , ( 'GET' , ( prefix_listing_prefix + 'marker=&end_marker=001o/3' ) ) , ( 'GET' , ( body + 'marker=001o/1&end_marker=001o/3' ) ) , ( 'GET' , ( prefix_listing_prefix + 'marker=001o/2&end_marker=001o/3' ) ) , ( 'GET' , '/v1/a/ver_cont/001o/2' ) , ( 'PUT' , '/v1/a/c/o' ) , ( 'DELETE' , '/v1/a/ver_cont/001o/2' ) ] )