2012-08-15 11:31:36 -04:00
|
|
|
Shindo.tests('Fog::Storage[:rackspace] | large object requests', ["rackspace"]) do
|
2011-06-24 19:00:44 -04:00
|
|
|
|
2011-07-20 13:11:10 -04:00
|
|
|
unless Fog.mocking?
|
|
|
|
@directory = Fog::Storage[:rackspace].directories.create(:key => 'foglargeobjecttests')
|
|
|
|
end
|
2011-06-24 19:00:44 -04:00
|
|
|
|
|
|
|
tests('success') do
|
|
|
|
|
2011-07-20 13:11:10 -04:00
|
|
|
tests("#put_object('foglargeobjecttests', 'fog_large_object/1', ('x' * 6 * 1024 * 1024))").succeeds do
|
2011-06-24 19:00:44 -04:00
|
|
|
pending if Fog.mocking?
|
|
|
|
Fog::Storage[:rackspace].put_object(@directory.identity, 'fog_large_object/1', ('x' * 6 * 1024 * 1024))
|
|
|
|
end
|
|
|
|
|
2011-07-20 13:11:10 -04:00
|
|
|
tests("#put_object('foglargeobjecttests', 'fog_large_object/2', ('x' * 4 * 1024 * 1024))").succeeds do
|
2011-06-24 19:00:44 -04:00
|
|
|
pending if Fog.mocking?
|
|
|
|
Fog::Storage[:rackspace].put_object(@directory.identity, 'fog_large_object/2', ('x' * 4 * 1024 * 1024))
|
|
|
|
end
|
|
|
|
|
2011-07-20 13:11:10 -04:00
|
|
|
tests("#put_object_manifest('foglargeobjecttests', 'fog_large_object')").succeeds do
|
2011-06-24 19:00:44 -04:00
|
|
|
pending if Fog.mocking?
|
|
|
|
Fog::Storage[:rackspace].put_object_manifest(@directory.identity, 'fog_large_object')
|
|
|
|
end
|
|
|
|
|
2011-07-20 13:11:10 -04:00
|
|
|
tests("#get_object('foglargeobjecttests', 'fog_large_object').body").succeeds do
|
2011-06-24 19:00:44 -04:00
|
|
|
pending if Fog.mocking?
|
|
|
|
Fog::Storage[:rackspace].get_object(@directory.identity, 'fog_large_object').body == ('x' * 10 * 1024 * 1024)
|
|
|
|
end
|
|
|
|
|
2011-07-20 13:11:10 -04:00
|
|
|
unless Fog.mocking?
|
2011-06-24 19:00:44 -04:00
|
|
|
['fog_large_object', 'fog_large_object/1', 'fog_large_object/2'].each do |key|
|
|
|
|
@directory.files.new(:key => key).destroy
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
tests('failure') do
|
|
|
|
|
|
|
|
tests("put_object_manifest")
|
|
|
|
|
|
|
|
end
|
|
|
|
|
2011-07-20 13:11:10 -04:00
|
|
|
unless Fog.mocking?
|
|
|
|
@directory.destroy
|
|
|
|
end
|
2011-06-24 19:00:44 -04:00
|
|
|
|
|
|
|
end
|