#NEWLINE# def test_remove_all_versions_recursive_on_subdir( self ) : #NEWLINE# #INDENT# "Test that 'rm -r' works on subdir." #NEWLINE# bucket_uri = self . CreateVersionedBucket ( ) #NEWLINE# k1_uri = bucket_uri . clone_replace_name ( 'dir/foo' ) #NEWLINE# k2_uri = bucket_uri . clone_replace_name ( 'dir/foo2' ) #NEWLINE# k1_uri . set_contents_from_string ( 'bar' ) #NEWLINE# k2_uri . set_contents_from_string ( 'bar2' ) #NEWLINE# k1g1 = urigen ( k1_uri ) #NEWLINE# k2g1 = urigen ( k2_uri ) #NEWLINE# k1_uri . set_contents_from_string ( 'baz' ) #NEWLINE# k2_uri . set_contents_from_string ( 'baz2' ) #NEWLINE# k1g2 = urigen ( k1_uri ) #NEWLINE# k2g2 = urigen ( k2_uri ) #NEWLINE# self . AssertNObjectsInBucket ( bucket_uri , 4 , versioned = True ) #NEWLINE# self . _RunRemoveCommandAndCheck ( [ 'rm' , '-r' , ( '%s' % suri ( bucket_uri , 'dir' ) ) ] , objects_to_remove = [ ( '%s#%s' % ( suri ( k1_uri ) , k1g1 ) ) , ( '%s#%s' % ( suri ( k1_uri ) , k1g2 ) ) , ( '%s#%s' % ( suri ( k2_uri ) , k2g1 ) ) , ( '%s#%s' % ( suri ( k2_uri ) , k2g2 ) ) ] ) #NEWLINE# self . AssertNObjectsInBucket ( bucket_uri , 0 , versioned = True )