From df41397601a9334123e92b2a41a69e4983790b61 Mon Sep 17 00:00:00 2001 From: Mike Hagedorn Date: Wed, 6 Mar 2013 12:34:52 -0600 Subject: [PATCH] added limits unit test --- lib/fog/hp/requests/lb/list_limits.rb | 13 +++++++++++++ tests/hp/requests/lb/list_limits.rb | 18 ++++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 tests/hp/requests/lb/list_limits.rb diff --git a/lib/fog/hp/requests/lb/list_limits.rb b/lib/fog/hp/requests/lb/list_limits.rb index c354d11fd..1b3cb84fb 100644 --- a/lib/fog/hp/requests/lb/list_limits.rb +++ b/lib/fog/hp/requests/lb/list_limits.rb @@ -16,6 +16,19 @@ module Fog class Mock def list_limits response = Excon::Response.new + response.status = 200 + response.body = { + "limits" => { + "absolute" => { + "values" => { + "maxLoadBalancerNameLength" => 128, + "maxLoadBalancers" => 20, + "maxNodesPerLoadBalancer" => 5, + "maxVIPsPerLoadBalancer" => 1 + } + } + } + } response end diff --git a/tests/hp/requests/lb/list_limits.rb b/tests/hp/requests/lb/list_limits.rb new file mode 100644 index 000000000..610eb59fb --- /dev/null +++ b/tests/hp/requests/lb/list_limits.rb @@ -0,0 +1,18 @@ +Shindo.tests("Fog::HP::LB | list limits", ['hp', 'lb', 'limits']) do + @limits_format = { + 'maxLoadBalancerNameLength' => Integer, + 'maxLoadBalancers' => Integer, + 'maxNodesPerLoadBalancer' => Integer, + 'maxVIPsPerLoadBalancer' => Integer, + } + + + tests('success') do + + tests("#list_limits").formats({'limits' => {"absolute" => {"values" => @limits_format }}}) do + HP[:lb].list_limits.body + end + end + + +end \ No newline at end of file