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

Add HP provider and credentials to support testing with mocks.

This commit is contained in:
Rupak Ganguly 2012-03-30 18:13:13 -04:00
parent eb5e3fe279
commit da7d8f30e7
3 changed files with 58 additions and 1 deletions

View file

@ -8,7 +8,7 @@ def lorem_file
end
# check to see which credentials are available and add others to the skipped tags list
all_providers = ['aws', 'bluebox', 'brightbox', 'dnsimple', 'dnsmadeeasy', 'dynect', 'ecloud', 'glesys', 'gogrid', 'google', 'linode', 'local', 'ninefold', 'newservers', 'openstack', 'rackspace', 'slicehost', 'stormondemand', 'voxel', 'zerigo']
all_providers = ['aws', 'bluebox', 'brightbox', 'dnsimple', 'dnsmadeeasy', 'dynect', 'ecloud', 'glesys', 'gogrid', 'google', 'hp', 'linode', 'local', 'ninefold', 'newservers', 'openstack', 'rackspace', 'slicehost', 'stormondemand', 'voxel', 'zerigo']
available_providers = Fog.available_providers.map {|provider| provider.downcase}
for provider in (all_providers - available_providers)
Formatador.display_line("[yellow]Skipping tests for [bold]#{provider}[/] [yellow]due to lacking credentials (add some to '~/.fog' to run them)[/]")

View file

@ -28,6 +28,8 @@ if Fog.mock?
:go_grid_shared_secret => 'go_grid_shared_secret',
:google_storage_access_key_id => 'google_storage_access_key_id',
:google_storage_secret_access_key => 'google_storage_secret_access_key',
:hp_account_id => 'hp_account_id',
:hp_secret_key => 'hp_secret_key',
:linode_api_key => 'linode_api_key',
:local_root => '~/.fog',
:new_servers_password => 'new_servers_password',

View file

@ -0,0 +1,55 @@
Shindo.tests('Fog::Storage[:hp] | container requests', [:hp]) do
@container_format = [String]
@containers_format = [{
'bytes' => Integer,
'count' => Integer,
'name' => String
}]
tests('success') do
tests("#put_container('fogcontainertests')").succeeds do
Fog::Storage[:hp].put_container('fogcontainertests')
end
tests("#get_container('fogcontainertests')").formats(@container_format) do
Fog::Storage[:hp].get_container('fogcontainertests').body
end
tests("#get_containers").formats(@containers_format) do
Fog::Storage[:hp].get_containers.body
end
tests("#head_container('fogcontainertests')").succeeds do
Fog::Storage[:hp].head_container('fogcontainertests')
end
tests("#head_containers").succeeds do
Fog::Storage[:hp].head_containers
end
tests("#delete_container('fogcontainertests')").succeeds do
Fog::Storage[:hp].delete_container('fogcontainertests')
end
end
tests('failure') do
tests("#get_container('fognoncontainer')").raises(Fog::Storage::HP::NotFound) do
Fog::Storage[:hp].get_container('fognoncontainer')
end
tests("#head_container('fognoncontainer')").raises(Fog::Storage::HP::NotFound) do
Fog::Storage[:hp].head_container('fognoncontainer')
end
tests("#delete_container('fognoncontainer')").raises(Fog::Storage::HP::NotFound) do
Fog::Storage[:hp].delete_container('fognoncontainer')
end
end
end