mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
enable 2 failure tests, minor obfuscates
This commit is contained in:
parent
f6a10018d7
commit
7304b5e600
4 changed files with 14 additions and 10 deletions
|
@ -22,7 +22,7 @@ module Fog
|
|||
response = Excon::Response.new
|
||||
response.status = 200
|
||||
response.body = {
|
||||
"id" => "mock_id",
|
||||
"id" => check_id,
|
||||
"label" => nil,
|
||||
"type" => "remote.ping",
|
||||
"details" => {"count"=>5},
|
||||
|
@ -44,7 +44,7 @@ module Fog
|
|||
"X-RateLimit-Remaining" => "44676",
|
||||
"X-RateLimit-Window" => "24 hours",
|
||||
"X-RateLimit-Type" => "global",
|
||||
"X-Response-Id" => ".rh-QScV.h-ord1-maas-prod-api0.r-uuWnOhLS.c-206541.ts-1377805994157.v-9c40430",
|
||||
"X-Response-Id" => "jdnbono34090934nggn",
|
||||
"X-LB" => "ord1-maas-prod-api0",
|
||||
"Vary" => "Accept-Encoding",
|
||||
"Transfer-Encoding" => "chunked"
|
||||
|
|
|
@ -75,12 +75,12 @@ module Fog
|
|||
"X-RateLimit-Remaining" => "49627",
|
||||
"X-RateLimit-Window" => "24 hours",
|
||||
"X-RateLimit-Type" => "global",
|
||||
"X-Response-Id" =>" zsdvasdtrq345",
|
||||
"X-Response-Id" => "zsdvasdtrq345",
|
||||
"X-LB" => "dfw1-maas-prod-api0",
|
||||
"Vary" => "Accept-Encoding",
|
||||
"Transfer-Encoding" => "chunked"
|
||||
}
|
||||
response.remote_ip = "1.1.1.1"
|
||||
response.remote_ip = Fog::Rackspace::MockData.ipv4_address
|
||||
response
|
||||
end
|
||||
end
|
||||
|
|
|
@ -14,12 +14,19 @@ module Fog
|
|||
|
||||
class Mock
|
||||
def list_checks(entity_id)
|
||||
|
||||
check_id = Fog::Mock.random_letters(10)
|
||||
|
||||
if entity_id == -1
|
||||
raise Fog::Rackspace::Monitoring::NotFound
|
||||
end
|
||||
|
||||
response = Excon::Response.new
|
||||
response.status = 200
|
||||
response.body = {
|
||||
"values" => [
|
||||
{
|
||||
"id" => "mock_id",
|
||||
"id" => check_id,
|
||||
"label" => "load",
|
||||
"type" => "agent.load_average",
|
||||
"details" => {},
|
||||
|
@ -50,12 +57,12 @@ module Fog
|
|||
"X-RateLimit-Remaining" => "49627",
|
||||
"X-RateLimit-Window" => "24 hours",
|
||||
"X-RateLimit-Type" => "global",
|
||||
"X-Response-Id" =>" j23jlk234jl2j34j",
|
||||
"X-Response-Id" => "j23jlk234jl2j34j",
|
||||
"X-LB" => "dfw1-maas-prod-api0",
|
||||
"Vary" => "Accept-Encoding",
|
||||
"Transfer-Encoding" => "chunked"
|
||||
}
|
||||
response.remote_ip = "1.1.1.1"
|
||||
response.remote_ip = Fog::Rackspace::MockData.ipv4_address
|
||||
response
|
||||
end
|
||||
end
|
||||
|
|
|
@ -45,11 +45,9 @@ Shindo.tests('Fog::Rackspace::Monitoring | list_tests', ['rackspace','rackspace_
|
|||
end
|
||||
tests('failure') do
|
||||
tests('#fail to list checks').raises(Fog::Rackspace::Monitoring::NotFound) do
|
||||
pending if Fog.mocking?
|
||||
account.list_checks(-1)
|
||||
end
|
||||
tests('#fail to list check types').raises(ArgumentError) do
|
||||
pending if Fog.mocking?
|
||||
account.list_check_types(-1)
|
||||
end
|
||||
# This test has been put on hold due to a bug that incorrectly returns 200 OK to this request
|
||||
|
@ -57,7 +55,6 @@ Shindo.tests('Fog::Rackspace::Monitoring | list_tests', ['rackspace','rackspace_
|
|||
#account.list_metrics(-1,-1)
|
||||
#end
|
||||
tests('#fail: 1 argument instead of 0 for list_notification_plans').raises(ArgumentError) do
|
||||
pending if Fog.mocking?
|
||||
account.list_notification_plans('fail')
|
||||
end
|
||||
tests('#fail to get list of data points').raises(Fog::Rackspace::Monitoring::BadRequest) do
|
||||
|
|
Loading…
Reference in a new issue