tests/rackspace/requests/monitoring/agent_tests.rb in fog-1.22.0 vs tests/rackspace/requests/monitoring/agent_tests.rb in fog-1.22.1
- old
+ new
@@ -2,11 +2,11 @@
account = Fog::Rackspace::Monitoring.new
agent_token = nil
options = { "label" => "Bar" }
values_format = Hash
-
+
tests('success') do
tests('#create new agent token').formats(DATA_FORMAT) do
response = account.create_agent_token(options).data
agent_token = response[:headers]["X-Object-ID"]
response
@@ -14,16 +14,15 @@
tests('#list agent tokens').formats(LIST_HEADERS_FORMAT) do
account.list_agent_tokens().data[:headers]
end
tests("#list_agents") do
data_matches_schema(values_format, {:allow_extra_keys => true}) { account.list_agents.body }
- end
+ end
tests("#get_agent") do
data_matches_schema(values_format, {:allow_extra_keys => true}) { account.get_agent("agent_id").body }
end
-
tests('#get agent token').formats(LIST_HEADERS_FORMAT) do
account.get_agent_token(agent_token).data[:headers]
end
tests('#delete agent token').formats(DELETE_HEADERS_FORMAT) do
account.delete_agent_token(agent_token).data[:headers]
@@ -49,12 +48,12 @@
tests("#get_processes_info") do
data_matches_schema(values_format, {:allow_extra_keys => true}) { account.get_processes_info("agent_id").body }
end
tests("#get_system_info") do
data_matches_schema(values_format, {:allow_extra_keys => true}) { account.get_system_info("agent_id").body }
- end
-
+ end
+
end
tests('failure') do
tests('#fail to create agent token(-1)').raises(TypeError) do
account.create_agent_token(-1)
@@ -68,8 +67,8 @@
tests('#fail to connect to agent(-1)').raises(Fog::Rackspace::Monitoring::BadRequest) do
account.get_cpus_info(-1)
end
tests('#fail to get agent (-1)').raises(Fog::Rackspace::Monitoring::NotFound) do
account.get_agent(-1)
- end
+ end
end
end