Permalink
Browse files

Merge pull request #1125 from fcheung/fix-1.8.7-tests

Fix 1.8.7 tests
  • Loading branch information...
2 parents 93812c2 + 360a634 commit 47806f3b2ac519ad842adc36ea25f9e0649f55f1 @geemus geemus committed Sep 3, 2012
@@ -31,7 +31,7 @@ def successful?
# so dirty
def result
if successful? && model = Fog::Compute::Cloudstack.constants.find{|c| c.to_s.downcase == self.job_result.keys.first.to_s}.to_s
- collection = model.gsub(/.[A-Z]/){|w| "#{w[0]}_#{w[1].downcase}"}.downcase + "s" # cheap underscorize, assume simple pluralization
+ collection = model.gsub(/.[A-Z]/){|w| "#{w[0,1]}_#{w[1,1].downcase}"}.downcase + "s" # cheap underscorize, assume simple pluralization
connection.send(collection).new(self.job_result.values.first)
else self.job_result
end
@@ -25,14 +25,14 @@ def delete_security_group_rule(security_group_rule_id)
response = Excon::Response.new
sg_rule = nil
-
self.data[:security_groups].each do |_, sgv|
if sgv['rules']
- sg_rule = sgv['rules'].delete_if { |r| !r.nil? && r['id'] == security_group_rule_id }
- break if sg_rule
+ sg_rule_index = sgv['rules'].find_index { |r| !r.nil? && r['id'] == security_group_rule_id }
+ if sg_rule_index
+ sg_rule = sgv['rules'].delete_at sg_rule_index
+ end
end
end
-
if sg_rule && !sg_rule.empty?
response.status = 202
response.body = "202 Accepted\n\nThe request is accepted for processing.\n\n "
@@ -14,7 +14,7 @@ def list_roles_for_user_on_tenant(tenant_id, user_id)
class Mock
def list_roles_for_user_on_tenant(tenant_id, user_id)
Excon::Response.new(
- :body => { 'roles' => self.data[:roles] },
+ :body => { 'roles' => self.data[:roles].values },
:status => 200
)
end # def list_roles_for_user_on_tenant
@@ -20,6 +20,7 @@ class Mock
def list_tenants
Excon::Response.new(
:body => {
+ 'tenants_links' => [],
'tenants' => [
{'id' => '1',
'description' => 'Has access to everything',
@@ -2,7 +2,7 @@
Shindo.tests('AWS | url', ["aws"]) do
- @expires = DateTime.parse('2013-01-01T00:00:00Z').to_time.utc.to_i
+ @expires = Time.utc(2013,1,1).utc.to_i
@storage = Fog::Storage.new(
:provider => 'AWS',

0 comments on commit 47806f3

Please sign in to comment.