Skip to content

Commit 8b5cedd

Browse files
Add test for EBS volume creation without size (#12227)
1 parent 7224030 commit 8b5cedd

File tree

3 files changed

+25
-0
lines changed

3 files changed

+25
-0
lines changed

tests/aws/services/ec2/test_ec2.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -831,3 +831,10 @@ def test_create_specific_vpc_id(account_id, region_name, create_vpc, set_resourc
831831

832832
vpc = create_vpc(cidr_block=cidr_block)
833833
assert vpc["Vpc"]["VpcId"] == f"vpc-{custom_id}"
834+
835+
836+
@markers.aws.validated
837+
def test_raise_create_volume_without_size(snapshot, aws_client):
838+
with pytest.raises(ClientError) as e:
839+
aws_client.ec2.create_volume(AvailabilityZone="eu-central-1a")
840+
snapshot.match("request-missing-size", e.value.response)

tests/aws/services/ec2/test_ec2.snapshot.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -320,5 +320,20 @@
320320
}
321321
}
322322
}
323+
},
324+
"tests/aws/services/ec2/test_ec2.py::test_raise_create_volume_without_size": {
325+
"recorded-date": "04-02-2025, 12:53:29",
326+
"recorded-content": {
327+
"request-missing-size": {
328+
"Error": {
329+
"Code": "MissingParameter",
330+
"Message": "The request must contain the parameter size/snapshot"
331+
},
332+
"ResponseMetadata": {
333+
"HTTPHeaders": {},
334+
"HTTPStatusCode": 400
335+
}
336+
}
337+
}
323338
}
324339
}

tests/aws/services/ec2/test_ec2.validation.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,8 @@
1313
},
1414
"tests/aws/services/ec2/test_ec2.py::TestEc2Integrations::test_vcp_peering_difference_regions": {
1515
"last_validated_date": "2024-06-07T21:28:25+00:00"
16+
},
17+
"tests/aws/services/ec2/test_ec2.py::test_raise_create_volume_without_size": {
18+
"last_validated_date": "2025-02-04T12:53:29+00:00"
1619
}
1720
}

0 commit comments

Comments
 (0)