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

Merge pull request #2078 from rackspace/test_fix

[rackspace] fixing more broken tests
This commit is contained in:
Kyle Rames 2013-08-16 18:46:29 -07:00
commit bf7d348d88
5 changed files with 22 additions and 10 deletions

View file

@ -6,6 +6,10 @@ module Fog
class Rackspace < Fog::Service
include Fog::Rackspace::Errors
class ServiceError < Fog::Rackspace::Errors::ServiceError; end
class InternalServerError < Fog::Rackspace::Errors::InternalServerError; end
class BadRequest < Fog::Rackspace::Errors::BadRequest; end
requires :rackspace_api_key, :rackspace_username
recognizes :rackspace_auth_url, :rackspace_servicenet, :persistent
recognizes :rackspace_auth_token, :rackspace_management_url, :rackspace_compute_v1_url, :rackspace_region

View file

@ -19,7 +19,7 @@ module Fog
# @raise [Fog::Compute::RackspaceV2::ServiceError]
def destroy
requires :identity
connection.delete_metadata_item(collection_name, parent.id, key)
service.delete_metadata_item(collection_name, parent.id, key)
true
end
@ -31,7 +31,7 @@ module Fog
# @raise [Fog::Compute::RackspaceV2::ServiceError]
def save
requires :identity, :value
connection.set_metadata_item(collection_name, parent.id, key, value)
service.set_metadata_item(collection_name, parent.id, key, value)
true
end

View file

@ -91,19 +91,19 @@ module Fog
def enable_content_caching
requires :identity
connection.set_content_caching identity, true
service.set_content_caching identity, true
true
end
def disable_content_caching
requires :identity
connection.set_content_caching identity, false
service.set_content_caching identity, false
true
end
def content_caching
requires :identity
connection.get_content_caching(identity).body['contentCaching']['enabled']
service.get_content_caching(identity).body['contentCaching']['enabled']
end
def enable_connection_logging

View file

@ -106,7 +106,7 @@ Shindo.tests('Fog::Compute::RackspaceV2 | server_tests', ['rackspace']) do
sleep 120 unless Fog.mocking?
tests('#resize_server').succeeds do
resize_flavor_id = flavor_id
resize_flavor_id = Fog.mocking? ? flavor_id : service.flavors[1].id
service.resize_server(server_id, resize_flavor_id)
end
wait_for_server_state(service, server_id, 'VERIFY_RESIZE', 'ACTIVE')

View file

@ -304,12 +304,20 @@ Shindo.tests('Fog::Storage[:rackspace] | large object requests', ['rackspace'])
end
end
tests('#delete_static_large_object with missing container').raises(Fog::Storage::Rackspace::NotFound) do
Fog::Storage[:rackspace].delete_static_large_object('fognoncontainer', 'fog_large_object')
tests('#delete_static_large_object with missing container') do
response = Fog::Storage[:rackspace].delete_static_large_object('fognoncontainer', 'fog_large_object')
returns(200) { response.status }
returns(0) { response.body["Number Not Found"] }
returns("400 Bad Request") { response.body["Response Status"]}
returns("Invalid bulk delete.") { response.body["Response Body"]}
end
tests('#delete_static_large_object with missing manifest').raises(Fog::Storage::Rackspace::NotFound) do
Fog::Storage[:rackspace].delete_static_large_object(@directory.identity, 'fog_non_object')
tests('#delete_static_large_object with missing manifest') do
response = Fog::Storage[:rackspace].delete_static_large_object(@directory.identity, 'fog_non_object')
returns(200) { response.status }
returns(0) { response.body["Number Not Found"] }
returns("400 Bad Request") { response.body["Response Status"]}
returns("Invalid bulk delete.") { response.body["Response Body"]}
end
tests('#delete_static_large_object with missing segment') do