Techdebt: Revert vpc test changes (#6631)
This commit is contained in:
parent
db0bec1418
commit
110cf01e8a
@ -1,14 +1,12 @@
|
|||||||
"""Unit tests specific to VPC endpoint services."""
|
"""Unit tests specific to VPC endpoint services."""
|
||||||
import boto3
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
|
import boto3
|
||||||
from botocore.exceptions import ClientError
|
from botocore.exceptions import ClientError
|
||||||
from unittest import SkipTest
|
|
||||||
|
|
||||||
from moto import mock_ec2, mock_elbv2, settings
|
from moto import mock_ec2, settings
|
||||||
from moto.core import DEFAULT_ACCOUNT_ID as ACCOUNT_ID
|
from moto.core import DEFAULT_ACCOUNT_ID as ACCOUNT_ID
|
||||||
|
from unittest import SkipTest
|
||||||
from .test_vpc_service_configuration import create_load_balancer
|
|
||||||
|
|
||||||
|
|
||||||
@mock_ec2
|
@mock_ec2
|
||||||
@ -265,35 +263,3 @@ def test_describe_vpc_default_endpoint_services():
|
|||||||
assert details["ServiceName"] == "com.amazonaws.us-west-1.config"
|
assert details["ServiceName"] == "com.amazonaws.us-west-1.config"
|
||||||
assert details["ServiceType"] == [{"ServiceType": "Interface"}]
|
assert details["ServiceType"] == [{"ServiceType": "Interface"}]
|
||||||
assert details["VpcEndpointPolicySupported"] is True
|
assert details["VpcEndpointPolicySupported"] is True
|
||||||
|
|
||||||
|
|
||||||
@mock_ec2
|
|
||||||
@mock_elbv2
|
|
||||||
def test_create_vpc_endpoint_service_configuration_with_options():
|
|
||||||
client = boto3.client("ec2", region_name="us-east-2")
|
|
||||||
|
|
||||||
lb_arn = create_load_balancer(
|
|
||||||
region_name="us-east-2", lb_type="gateway", zone="us-east-1c"
|
|
||||||
)
|
|
||||||
|
|
||||||
config = client.create_vpc_endpoint_service_configuration(
|
|
||||||
GatewayLoadBalancerArns=[lb_arn],
|
|
||||||
AcceptanceRequired=False,
|
|
||||||
PrivateDnsName="example.com",
|
|
||||||
)["ServiceConfiguration"]
|
|
||||||
|
|
||||||
assert config["AcceptanceRequired"] is False
|
|
||||||
assert config["PrivateDnsName"] == "example.com"
|
|
||||||
assert config["PrivateDnsNameConfiguration"] == {
|
|
||||||
"Name": "n",
|
|
||||||
"State": "verified",
|
|
||||||
"Type": "TXT",
|
|
||||||
"Value": "val",
|
|
||||||
}
|
|
||||||
|
|
||||||
service_name = config["ServiceName"]
|
|
||||||
detail = client.describe_vpc_endpoint_services(ServiceNames=[service_name])[
|
|
||||||
"ServiceDetails"
|
|
||||||
][0]
|
|
||||||
assert detail["ServiceName"] == service_name
|
|
||||||
assert detail["Owner"] == ACCOUNT_ID
|
|
||||||
|
@ -3,6 +3,7 @@ import pytest
|
|||||||
|
|
||||||
from botocore.exceptions import ClientError
|
from botocore.exceptions import ClientError
|
||||||
from moto import mock_ec2, mock_elbv2
|
from moto import mock_ec2, mock_elbv2
|
||||||
|
from moto.core import DEFAULT_ACCOUNT_ID
|
||||||
from moto.moto_api._internal import mock_random
|
from moto.moto_api._internal import mock_random
|
||||||
|
|
||||||
# See our Development Tips on writing tests for hints on how to write good tests:
|
# See our Development Tips on writing tests for hints on how to write good tests:
|
||||||
@ -92,6 +93,38 @@ def test_create_vpc_endpoint_service_configuration_with_gateway_load_balancer():
|
|||||||
assert "NetworkLoadBalancerArns" not in config
|
assert "NetworkLoadBalancerArns" not in config
|
||||||
|
|
||||||
|
|
||||||
|
@mock_ec2
|
||||||
|
@mock_elbv2
|
||||||
|
def test_create_vpc_endpoint_service_configuration_with_options():
|
||||||
|
client = boto3.client("ec2", region_name="us-east-2")
|
||||||
|
|
||||||
|
lb_arn = create_load_balancer(
|
||||||
|
region_name="us-east-2", lb_type="gateway", zone="us-east-1c"
|
||||||
|
)
|
||||||
|
|
||||||
|
config = client.create_vpc_endpoint_service_configuration(
|
||||||
|
GatewayLoadBalancerArns=[lb_arn],
|
||||||
|
AcceptanceRequired=False,
|
||||||
|
PrivateDnsName="example.com",
|
||||||
|
)["ServiceConfiguration"]
|
||||||
|
|
||||||
|
assert config["AcceptanceRequired"] is False
|
||||||
|
assert config["PrivateDnsName"] == "example.com"
|
||||||
|
assert config["PrivateDnsNameConfiguration"] == {
|
||||||
|
"Name": "n",
|
||||||
|
"State": "verified",
|
||||||
|
"Type": "TXT",
|
||||||
|
"Value": "val",
|
||||||
|
}
|
||||||
|
|
||||||
|
service_name = config["ServiceName"]
|
||||||
|
detail = client.describe_vpc_endpoint_services(ServiceNames=[service_name])[
|
||||||
|
"ServiceDetails"
|
||||||
|
][0]
|
||||||
|
assert detail["ServiceName"] == service_name
|
||||||
|
assert detail["Owner"] == DEFAULT_ACCOUNT_ID
|
||||||
|
|
||||||
|
|
||||||
@mock_ec2
|
@mock_ec2
|
||||||
@mock_elbv2
|
@mock_elbv2
|
||||||
def test_describe_vpc_endpoint_service_configurations():
|
def test_describe_vpc_endpoint_service_configurations():
|
Loading…
Reference in New Issue
Block a user