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:
commit
bf7d348d88
5 changed files with 22 additions and 10 deletions
|
@ -6,6 +6,10 @@ module Fog
|
||||||
class Rackspace < Fog::Service
|
class Rackspace < Fog::Service
|
||||||
include Fog::Rackspace::Errors
|
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
|
requires :rackspace_api_key, :rackspace_username
|
||||||
recognizes :rackspace_auth_url, :rackspace_servicenet, :persistent
|
recognizes :rackspace_auth_url, :rackspace_servicenet, :persistent
|
||||||
recognizes :rackspace_auth_token, :rackspace_management_url, :rackspace_compute_v1_url, :rackspace_region
|
recognizes :rackspace_auth_token, :rackspace_management_url, :rackspace_compute_v1_url, :rackspace_region
|
||||||
|
|
|
@ -19,7 +19,7 @@ module Fog
|
||||||
# @raise [Fog::Compute::RackspaceV2::ServiceError]
|
# @raise [Fog::Compute::RackspaceV2::ServiceError]
|
||||||
def destroy
|
def destroy
|
||||||
requires :identity
|
requires :identity
|
||||||
connection.delete_metadata_item(collection_name, parent.id, key)
|
service.delete_metadata_item(collection_name, parent.id, key)
|
||||||
true
|
true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -31,7 +31,7 @@ module Fog
|
||||||
# @raise [Fog::Compute::RackspaceV2::ServiceError]
|
# @raise [Fog::Compute::RackspaceV2::ServiceError]
|
||||||
def save
|
def save
|
||||||
requires :identity, :value
|
requires :identity, :value
|
||||||
connection.set_metadata_item(collection_name, parent.id, key, value)
|
service.set_metadata_item(collection_name, parent.id, key, value)
|
||||||
true
|
true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -91,19 +91,19 @@ module Fog
|
||||||
|
|
||||||
def enable_content_caching
|
def enable_content_caching
|
||||||
requires :identity
|
requires :identity
|
||||||
connection.set_content_caching identity, true
|
service.set_content_caching identity, true
|
||||||
true
|
true
|
||||||
end
|
end
|
||||||
|
|
||||||
def disable_content_caching
|
def disable_content_caching
|
||||||
requires :identity
|
requires :identity
|
||||||
connection.set_content_caching identity, false
|
service.set_content_caching identity, false
|
||||||
true
|
true
|
||||||
end
|
end
|
||||||
|
|
||||||
def content_caching
|
def content_caching
|
||||||
requires :identity
|
requires :identity
|
||||||
connection.get_content_caching(identity).body['contentCaching']['enabled']
|
service.get_content_caching(identity).body['contentCaching']['enabled']
|
||||||
end
|
end
|
||||||
|
|
||||||
def enable_connection_logging
|
def enable_connection_logging
|
||||||
|
|
|
@ -106,7 +106,7 @@ Shindo.tests('Fog::Compute::RackspaceV2 | server_tests', ['rackspace']) do
|
||||||
sleep 120 unless Fog.mocking?
|
sleep 120 unless Fog.mocking?
|
||||||
|
|
||||||
tests('#resize_server').succeeds do
|
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)
|
service.resize_server(server_id, resize_flavor_id)
|
||||||
end
|
end
|
||||||
wait_for_server_state(service, server_id, 'VERIFY_RESIZE', 'ACTIVE')
|
wait_for_server_state(service, server_id, 'VERIFY_RESIZE', 'ACTIVE')
|
||||||
|
|
|
@ -304,12 +304,20 @@ Shindo.tests('Fog::Storage[:rackspace] | large object requests', ['rackspace'])
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
tests('#delete_static_large_object with missing container').raises(Fog::Storage::Rackspace::NotFound) do
|
tests('#delete_static_large_object with missing container') do
|
||||||
Fog::Storage[:rackspace].delete_static_large_object('fognoncontainer', 'fog_large_object')
|
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
|
end
|
||||||
|
|
||||||
tests('#delete_static_large_object with missing manifest').raises(Fog::Storage::Rackspace::NotFound) do
|
tests('#delete_static_large_object with missing manifest') do
|
||||||
Fog::Storage[:rackspace].delete_static_large_object(@directory.identity, 'fog_non_object')
|
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
|
end
|
||||||
|
|
||||||
tests('#delete_static_large_object with missing segment') do
|
tests('#delete_static_large_object with missing segment') do
|
||||||
|
|
Loading…
Reference in a new issue