Permalink
Browse files

OpenStack: security group test fixes.

Update the OpenStack security group test to support the correct
format for create_security_group responses. This patch
removes the extra [] wrapping the response and makes it so the
real tests run once again.

Also updates the existing Mock for create_security_response so
it handles it properly as well.
  • Loading branch information...
dprince committed Nov 30, 2012
1 parent e4b382d commit db77300076a7fdb6344ea743e8b73486b5f26172
@@ -41,7 +41,7 @@ def create_security_group(name, description)
'Content-Length' => Fog::Mock.random_numbers(3).to_s,
'Date' => Date.new}
response.body = {
- 'security_group' => self.data[:security_groups].values
+ 'security_group' => self.data[:security_groups][security_group_id]
}
response
end
@@ -20,7 +20,7 @@
}
tests('success') do
- tests('#create_security_group(name, description)').formats({"security_group" => [@security_group_format]}) do
+ tests('#create_security_group(name, description)').formats({"security_group" => @security_group_format}) do
Fog::Compute[:openstack].create_security_group('from_shindo_test', 'this is from the shindo test').body
end

0 comments on commit db77300

Please sign in to comment.