mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
Add test for copying from one container to another.
This commit is contained in:
parent
ee064c2ac7
commit
af80601bd0
1 changed files with 9 additions and 0 deletions
|
@ -25,11 +25,20 @@ Shindo.tests('Fog::Storage[:hp] | object requests', [:hp]) do
|
|||
Fog::Storage[:hp].head_object(@dir_name, 'fog_object')
|
||||
end
|
||||
|
||||
# copy a file within the same container
|
||||
tests("#put_object('#{@dir_name}', 'fog_other_object', nil, {'X-Copy-From' => '/#{@dir_name}/fog_object'})" ).succeeds do
|
||||
Fog::Storage[:hp].put_object(@dir_name, 'fog_other_object', nil, {'X-Copy-From' => "/#{@dir_name}/fog_object"})
|
||||
end
|
||||
@directory.files.get('fog_other_object').destroy
|
||||
|
||||
# copy a file from one container to another
|
||||
@another_dir = Fog::Storage[:hp].directories.create(:key => 'fogobjecttests2')
|
||||
tests("#put_object('#{@another_dir.identity}', 'fog_another_object', nil, {'X-Copy-From' => '/#{@dir_name}/fog_object'})" ).succeeds do
|
||||
Fog::Storage[:hp].put_object(@another_dir.identity, 'fog_another_object', nil, {'X-Copy-From' => "/#{@dir_name}/fog_object"})
|
||||
end
|
||||
@another_dir.files.get('fog_another_object').destroy
|
||||
@another_dir.destroy
|
||||
|
||||
tests("#delete_object('#{@dir_name}', 'fog_object')").succeeds do
|
||||
Fog::Storage[:hp].delete_object(@dir_name, 'fog_object')
|
||||
end
|
||||
|
|
Loading…
Add table
Reference in a new issue