1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

Add request layer tests for object_temp_url functionality.

This commit is contained in:
Rupak Ganguly 2012-09-26 14:12:57 -04:00
parent 42a91a65d4
commit 2459a6b457

View file

@ -1,4 +1,4 @@
Shindo.tests('Fog::Storage[:hp] | object requests', [:hp]) do
Shindo.tests('Fog::Storage[:hp] | object requests', ['hp', 'storage']) do
@directory = Fog::Storage[:hp].directories.create(:key => 'fogobjecttests')
@dir_name = @directory.identity
@ -25,6 +25,10 @@ Shindo.tests('Fog::Storage[:hp] | object requests', [:hp]) do
Fog::Storage[:hp].head_object(@dir_name, 'fog_object')
end
tests("#get_object_temp_url('#{@dir_name}', 'fog_object', 60, 'GET')").succeeds do
Fog::Storage[:hp].get_object_temp_url(@dir_name, 'fog_object', 60, 'GET')
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"})
@ -58,6 +62,10 @@ Shindo.tests('Fog::Storage[:hp] | object requests', [:hp]) do
Fog::Storage[:hp].get_object('fognoncontainer', 'fog_non_object')
end
tests("#get_object_temp_url('#{@dir_name}', 'fog_object', 60, 'POST')").raises(ArgumentError) do
Fog::Storage[:hp].get_object_temp_url(@dir_name, 'fog_object', 60, 'POST')
end
tests("#head_object('#{@dir_name}', 'fog_non_object')").raises(Fog::Storage::HP::NotFound) do
Fog::Storage[:hp].head_object(@dir_name, 'fog_non_object')
end