1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

Enable tests when mocking

This commit is contained in:
Trotter Cashion 2012-07-02 16:53:36 -07:00
parent d0f947f07f
commit 29a7bef5e7
4 changed files with 13 additions and 16 deletions

View file

@ -78,9 +78,8 @@ module Fog
data[:launch_configurations][launch_configuration_name] = {
'BlockDeviceMappings' => [],
'CreatedTime' => Time.now.utc,
'IamInstanceProfile' => nil,
'ImageId' => image_id,
'InstanceMonitoring.Enabled' => true,
'InstanceMonitoring' => {'Enabled' => true},
'InstanceType' => instance_type,
'KernelId' => nil,
'KeyName' => nil,

View file

@ -35,20 +35,17 @@ module Fog
class Mock
def delete_auto_scaling_group(auto_scaling_group_name)
unless self.data[:auto_scaling_groups].delete(auto_scaling_group_name)
raise Fog::AWS::Autoscaling::NotFound, "The auto scaling group '#{auto_scaling_group_name}' does not exist."
end
response = Excon::Response.new
if data[:auto_scaling_groups].delete(auto_scaling_group_name)
response.status = true
response.status = 200
response.body = {
'requestId' => Fog::AWS::Mock.request_id,
'return' => true
'ResponseMetadata' => { 'RequestId' => Fog::AWS::Mock.request_id }
}
response
else
raise Fog::AWS::Autoscaling::NotFound.new("The auto scaling group '#{auto_scaling_group_name}' does not exist.")
end
end
end
end

View file

@ -73,7 +73,6 @@ module Fog
def describe_auto_scaling_instances(options = {})
results = { 'AutoScalingInstances' => [] }
data[:auto_scaling_groups].each do |asg_name, asg_data|
lc_name = data[asg_data][lc_name]
asg_data['Instances'].each do |instance|
results['AutoScalingInstances'] << {
'AutoScalingGroupName' => asg_name

View file

@ -3,8 +3,6 @@ Shindo.tests('AWS::AutoScaling | auto_scaling_tests', ['aws', 'auto_scaling']) d
@lc_name = 'fog-test-lc'
tests('success') do
pending if Fog.mocking?
tests("#describe_adjustment_types").formats(AWS::AutoScaling::Formats::DESCRIBE_ADJUSTMENT_TYPES) do
Fog::AWS[:auto_scaling].describe_adjustment_types.body
end
@ -54,15 +52,19 @@ Shindo.tests('AWS::AutoScaling | auto_scaling_tests', ['aws', 'auto_scaling']) d
end
tests("#describe_scaling_activities").formats(AWS::AutoScaling::Formats::DESCRIBE_SCALING_ACTIVITIES) do
pending if Fog.mocking?
Fog::AWS[:auto_scaling].describe_scaling_activities().body
end
tests("#describe_scaling_activities").formats(AWS::AutoScaling::Formats::DESCRIBE_SCALING_ACTIVITIES) do
pending if Fog.mocking?
Fog::AWS[:auto_scaling].describe_scaling_activities('ActivityIds' => '1').body
end
tests("#describe_scaling_activities").formats(AWS::AutoScaling::Formats::DESCRIBE_SCALING_ACTIVITIES) do
pending if Fog.mocking?
Fog::AWS[:auto_scaling].describe_scaling_activities('ActivityIds' => ['1', '2']).body
end
tests("#describe_scaling_activities").formats(AWS::AutoScaling::Formats::DESCRIBE_SCALING_ACTIVITIES) do
pending if Fog.mocking?
Fog::AWS[:auto_scaling].describe_scaling_activities('AutoScalingGroupName' => @asg_name).body
end