Skip to content

Commit

Permalink
Add test for case with no subnets on the VPC
Browse files Browse the repository at this point in the history
  • Loading branch information
ksugden committed Jan 24, 2025
1 parent dfb74ad commit 46f83e0
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tests/platform_helper/providers/test_vpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,17 @@ def test_get_vpc_failure_no_matching_public_subnets_in_response(self):

assert "No public subnets found in vpc 'my_vpc'" in str(ex)

@mock_aws
def test_get_vpc_failure_no_subnets_in_response(self):
mock_session, mock_client, _ = mock_vpc_info_session()
mock_client.describe_subnets.return_value = {"Subnets": []}
vpc_provider = VpcProvider(mock_session)

with pytest.raises(VpcProviderException) as ex:
vpc_provider.get_vpc("my_app", "my_env", "my_vpc")

assert "No subnets found for VPC with id: vpc-123456" in str(ex)

@mock_aws
def test_get_vpc_failure_no_matching_security_groups_in_response(self):
mock_session, mock_client, _ = mock_vpc_info_session()
Expand Down

0 comments on commit 46f83e0

Please sign in to comment.