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

[rackspace|load balancers] fixed broken tests

This commit is contained in:
Brian Hartsock 2011-08-16 22:22:24 -04:00
parent fa77c2ff1d
commit 56469d1d8d
10 changed files with 22 additions and 22 deletions

View file

@ -41,13 +41,13 @@ Shindo.tests('Fog::Rackspace::LoadBalancers | access_lists_tests', ['rackspace']
end end
tests('failure') do tests('failure') do
tests('create_access_rule(invalid ip)').raises(Fog::Rackspace::LoadBalancer::BadRequest) do tests('create_access_rule(invalid ip)').raises(Fog::Rackspace::LoadBalancers::BadRequest) do
@service.create_access_rule(@lb.id, '', 'ALLOW') @service.create_access_rule(@lb.id, '', 'ALLOW')
end end
tests('create_access_rule(invalid type)').raises(Fog::Rackspace::LoadBalancer::BadRequest) do tests('create_access_rule(invalid type)').raises(Fog::Rackspace::LoadBalancers::BadRequest) do
@service.create_access_rule(@lb.id, '10.10.10.10', 'ENABLED') @service.create_access_rule(@lb.id, '10.10.10.10', 'ENABLED')
end end
tests("delete_access_rule(#{@lb.id}, 0)").raises(Fog::Rackspace::LoadBalancer::NotFound) do tests("delete_access_rule(#{@lb.id}, 0)").raises(Fog::Rackspace::LoadBalancers::NotFound) do
@service.delete_access_rule(@lb.id, 0) @service.delete_access_rule(@lb.id, 0)
end end
end end

View file

@ -9,7 +9,7 @@ Shindo.tests('Fog::Rackspace::LoadBalancers | algorithm_tests', ['rackspace']) d
} }
]} ]}
@service = Fog::Rackspace::LoadBalancer.new @service = Fog::Rackspace::LoadBalancers.new
tests('success') do tests('success') do
tests('#list_algorithms').formats(ALGORITHMS_FORMAT) do tests('#list_algorithms').formats(ALGORITHMS_FORMAT) do

View file

@ -16,7 +16,7 @@ Shindo.tests('Fog::Rackspace::LoadBalancers | connection_logging', ['rackspace']
end end
tests('failure') do tests('failure') do
tests("#set_connection_logging(#{@lb.id}, 'aaa')").raises(Fog::Rackspace::LoadBalancer::InternalServerError) do tests("#set_connection_logging(#{@lb.id}, 'aaa')").raises(Fog::Rackspace::LoadBalancers::InternalServerError) do
@service.set_connection_logging(@lb.id, 'aaa') @service.set_connection_logging(@lb.id, 'aaa')
end end
end end

View file

@ -28,7 +28,7 @@ Shindo.tests('Fog::Rackspace::LoadBalancers | connection_throttling', ['rackspac
end end
tests('failure') do tests('failure') do
tests("#set_connection_throttling(#{@lb.id}, -1, -1, -1, -1)").raises(Fog::Rackspace::LoadBalancer::BadRequest) do tests("#set_connection_throttling(#{@lb.id}, -1, -1, -1, -1)").raises(Fog::Rackspace::LoadBalancers::BadRequest) do
@service.set_connection_throttling(@lb.id, -1, -1, -1, -1) @service.set_connection_throttling(@lb.id, -1, -1, -1, -1)
end end
end end

View file

@ -14,7 +14,7 @@ Shindo.tests('Fog::Rackspace::LoadBalancers | load_balancer_tests', ['rackspace'
data data
end end
tests("#update_load_balancer(#{@lb_id}) while immutable").raises(Fog::Rackspace::LoadBalancer::ServiceError) do tests("#update_load_balancer(#{@lb_id}) while immutable").raises(Fog::Rackspace::LoadBalancers::ServiceError) do
@service.update_load_balancer(@lb_id, { :port => 80 }).body @service.update_load_balancer(@lb_id, { :port => 80 }).body
end end
@ -45,17 +45,17 @@ Shindo.tests('Fog::Rackspace::LoadBalancers | load_balancer_tests', ['rackspace'
end end
tests('failure') do tests('failure') do
tests('#create_load_balancer(invalid name)').raises(Fog::Rackspace::LoadBalancer::BadRequest) do tests('#create_load_balancer(invalid name)').raises(Fog::Rackspace::LoadBalancers::BadRequest) do
@service.create_load_balancer('', 'HTTP', 80, [{ :type => 'PUBLIC'}], [{ :address => '10.0.0.1', :port => 80, :condition => 'ENABLED'}]) @service.create_load_balancer('', 'HTTP', 80, [{ :type => 'PUBLIC'}], [{ :address => '10.0.0.1', :port => 80, :condition => 'ENABLED'}])
end end
tests('#get_load_balancer(0)').raises(Fog::Rackspace::LoadBalancer::NotFound) do tests('#get_load_balancer(0)').raises(Fog::Rackspace::LoadBalancers::NotFound) do
@service.get_load_balancer(0) @service.get_load_balancer(0)
end end
tests('#delete_load_balancer(0)').raises(Fog::Rackspace::LoadBalancer::NotFound) do tests('#delete_load_balancer(0)').raises(Fog::Rackspace::LoadBalancers::NotFound) do
@service.delete_load_balancer(0) @service.delete_load_balancer(0)
end end
tests('#update_load_balancer(0)').raises(Fog::Rackspace::LoadBalancer::NotFound) do tests('#update_load_balancer(0)').raises(Fog::Rackspace::LoadBalancers::NotFound) do
@service.update_load_balancer(0, { :name => 'newname' }) @service.update_load_balancer(0, { :name => 'newname' })
end end
end end

View file

@ -33,11 +33,11 @@ Shindo.tests('Fog::Rackspace::LoadBalancers | monitor', ['rackspace']) do
end end
tests('failure') do tests('failure') do
tests("#set_monitor(#{@lb.id}, 'HTP', 5, 5, 5, 5)").raises(Fog::Rackspace::LoadBalancer::BadRequest) do tests("#set_monitor(#{@lb.id}, 'HTP', 5, 5, 5, 5)").raises(Fog::Rackspace::LoadBalancers::BadRequest) do
@service.set_monitor(@lb.id, 5, 5, 5, 5) @service.set_monitor(@lb.id, 5, 5, 5, 5)
end end
tests("#remove_monitor(#{@lb.id}) => No Monitor").raises(Fog::Rackspace::LoadBalancer::ServiceError) do tests("#remove_monitor(#{@lb.id}) => No Monitor").raises(Fog::Rackspace::LoadBalancers::ServiceError) do
@service.remove_monitor(@lb.id) @service.remove_monitor(@lb.id)
end end
end end

View file

@ -52,19 +52,19 @@ Shindo.tests('Fog::Rackspace::LoadBalancers | load_balancer_tests', ['rackspace'
end end
tests('failure') do tests('failure') do
tests('create_node(invalid ip)').raises(Fog::Rackspace::LoadBalancer::BadRequest) do tests('create_node(invalid ip)').raises(Fog::Rackspace::LoadBalancers::BadRequest) do
@service.create_node(@lb.id, '', 80, 'ENABLED') @service.create_node(@lb.id, '', 80, 'ENABLED')
end end
tests('create_node(invalid condition)').raises(Fog::Rackspace::LoadBalancer::BadRequest) do tests('create_node(invalid condition)').raises(Fog::Rackspace::LoadBalancers::BadRequest) do
@service.create_node(@lb.id, '10.10.10.10', 80, 'EABLED') @service.create_node(@lb.id, '10.10.10.10', 80, 'EABLED')
end end
tests('get_node(0)').raises(Fog::Rackspace::LoadBalancer::NotFound) do tests('get_node(0)').raises(Fog::Rackspace::LoadBalancers::NotFound) do
@service.get_node(@lb.id, 0) @service.get_node(@lb.id, 0)
end end
tests('delete_nodes(0)').raises(Fog::Rackspace::LoadBalancer::ServiceError) do tests('delete_nodes(0)').raises(Fog::Rackspace::LoadBalancers::ServiceError) do
@service.delete_nodes(@lb.id, 0) @service.delete_nodes(@lb.id, 0)
end end
tests('update_node(0)').raises(Fog::Rackspace::LoadBalancer::NotFound) do tests('update_node(0)').raises(Fog::Rackspace::LoadBalancers::NotFound) do
@service.update_node(@lb.id, 0, { :weight => 20 }) @service.update_node(@lb.id, 0, { :weight => 20 })
end end
end end

View file

@ -10,7 +10,7 @@ Shindo.tests('Fog::Rackspace::LoadBalancers | protocol_tests', ['rackspace']) do
} }
]} ]}
@service = Fog::Rackspace::LoadBalancer.new @service = Fog::Rackspace::LoadBalancers.new
tests('success') do tests('success') do

View file

@ -24,7 +24,7 @@ Shindo.tests('Fog::Rackspace::LoadBalancers | session_persistence', ['rackspace'
end end
tests('failure') do tests('failure') do
tests("#set_session_persistence(#{@lb.id}, 'aaa')").raises(Fog::Rackspace::LoadBalancer::BadRequest) do tests("#set_session_persistence(#{@lb.id}, 'aaa')").raises(Fog::Rackspace::LoadBalancers::BadRequest) do
@service.set_session_persistence(@lb.id, 'aaa') @service.set_session_persistence(@lb.id, 'aaa')
end end
end end

View file

@ -21,10 +21,10 @@ Shindo.tests('Fog::Rackspace::LoadBalancers | virtual_ip_tests', ['rackspace'])
tests('failure') do tests('failure') do
#TODO - I feel like this should really be a BadRequest, need to dig in #TODO - I feel like this should really be a BadRequest, need to dig in
tests('create_virtual_ip(invalid type)').raises(Fog::Rackspace::LoadBalancer::ServiceError) do tests('create_virtual_ip(invalid type)').raises(Fog::Rackspace::LoadBalancers::ServiceError) do
@service.create_virtual_ip(@lb.id, 'badtype') @service.create_virtual_ip(@lb.id, 'badtype')
end end
tests('delete_virtual_ip(0)').raises(Fog::Rackspace::LoadBalancer::NotFound) do tests('delete_virtual_ip(0)').raises(Fog::Rackspace::LoadBalancers::NotFound) do
@service.delete_virtual_ip(@lb.id, 0) @service.delete_virtual_ip(@lb.id, 0)
end end
end end