mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
Add support to #create_tags mock for internet gateways
This commit is contained in:
parent
4ee99f4ac6
commit
01d156c16b
5 changed files with 9 additions and 7 deletions
|
@ -223,7 +223,6 @@ module Fog
|
|||
:subnets => [],
|
||||
:vpcs => [],
|
||||
:dhcp_options => [],
|
||||
:internet_gateways => [],
|
||||
:route_tables => [],
|
||||
:account_attributes => [
|
||||
{
|
||||
|
|
|
@ -33,16 +33,17 @@ module Fog
|
|||
|
||||
class Mock
|
||||
def create_internet_gateway()
|
||||
self.data[:internet_gateways].push({
|
||||
'internetGatewayId' => Fog::AWS::Mock.request_id,
|
||||
gateway_id = Fog::AWS::Mock.internet_gateway_id
|
||||
self.data[:internet_gateways][gateway_id] = {
|
||||
'internetGatewayId' => gateway_id,
|
||||
'attachmentSet' => {},
|
||||
'tagSet' => {}
|
||||
})
|
||||
}
|
||||
Excon::Response.new(
|
||||
:status => 200,
|
||||
:body => {
|
||||
'requestId' => Fog::AWS::Mock.request_id,
|
||||
'internetGatewaySet' => self.data[:internet_gateways]
|
||||
'internetGatewaySet' => [self.data[:internet_gateways][gateway_id]]
|
||||
}
|
||||
)
|
||||
end
|
||||
|
|
|
@ -53,6 +53,8 @@ module Fog
|
|||
'snapshot'
|
||||
when /^vol\-[a-z0-9]{8}$/i
|
||||
'volume'
|
||||
when /^igw\-[a-z0-9]{8}$/i
|
||||
'internet_gateway'
|
||||
end
|
||||
if type && ((type == 'image' && visible_images[resource_id]) || self.data[:"#{type}s"][resource_id])
|
||||
{ 'resourceId' => resource_id, 'resourceType' => type }
|
||||
|
|
|
@ -30,7 +30,7 @@ module Fog
|
|||
Excon::Response.new.tap do |response|
|
||||
if internet_gateway_id
|
||||
response.status = 200
|
||||
self.data[:internet_gateways].reject! { |v| v['internetGatewayId'] == internet_gateway_id }
|
||||
self.data[:internet_gateways].delete(internet_gateway_id)
|
||||
|
||||
response.body = {
|
||||
'requestId' => Fog::AWS::Mock.request_id,
|
||||
|
|
|
@ -40,7 +40,7 @@ module Fog
|
|||
|
||||
class Mock
|
||||
def describe_internet_gateways(filters = {})
|
||||
internet_gateways = self.data[:internet_gateways]
|
||||
internet_gateways = self.data[:internet_gateways].values
|
||||
|
||||
if filters['internet-gateway-id']
|
||||
internet_gateways = internet_gateways.reject {|internet_gateway| internet_gateway['internetGatewayId'] != filters['internet-gateway-id']}
|
||||
|
|
Loading…
Add table
Reference in a new issue