Skip to content

Commit 87e29b6

Browse files
committed
fix
1 parent e83b618 commit 87e29b6

File tree

2 files changed

+20
-20
lines changed

2 files changed

+20
-20
lines changed

packages/aws-library/tests/test_ec2_client.py

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,7 @@ async def simcore_ec2_api(
5252
await ec2.close()
5353

5454

55-
async def test_ec2_client_lifespan(simcore_ec2_api: SimcoreEC2API):
56-
...
55+
async def test_ec2_client_lifespan(simcore_ec2_api: SimcoreEC2API): ...
5756

5857

5958
async def test_aiobotocore_ec2_client_when_ec2_server_goes_up_and_down(
@@ -107,12 +106,12 @@ async def test_get_ec2_instance_capabilities(
107106
simcore_ec2_api: SimcoreEC2API,
108107
ec2_allowed_instances: list[InstanceTypeType],
109108
):
110-
instance_types: list[
111-
EC2InstanceType
112-
] = await simcore_ec2_api.get_ec2_instance_capabilities(
113-
cast(
114-
set[InstanceTypeType],
115-
set(ec2_allowed_instances),
109+
instance_types: list[EC2InstanceType] = (
110+
await simcore_ec2_api.get_ec2_instance_capabilities(
111+
cast(
112+
set[InstanceTypeType],
113+
set(ec2_allowed_instances),
114+
)
116115
)
117116
)
118117
assert instance_types
@@ -125,7 +124,9 @@ async def test_get_ec2_instance_capabilities_returns_all_options(
125124
instance_types = await simcore_ec2_api.get_ec2_instance_capabilities("ALL")
126125
assert instance_types
127126
# NOTE: this might need adaptation when moto is updated
128-
assert 700 < len(instance_types) < 852
127+
assert (
128+
850 < len(instance_types) < 877
129+
), f"received {len(instance_types)}, the test might need adaptation"
129130

130131

131132
async def test_get_ec2_instance_capabilities_raise_with_empty_set(
@@ -151,9 +152,9 @@ async def fake_ec2_instance_type(
151152
request: pytest.FixtureRequest,
152153
) -> EC2InstanceType:
153154
instance_type_name: InstanceTypeType = request.param
154-
instance_types: list[
155-
EC2InstanceType
156-
] = await simcore_ec2_api.get_ec2_instance_capabilities({instance_type_name})
155+
instance_types: list[EC2InstanceType] = (
156+
await simcore_ec2_api.get_ec2_instance_capabilities({instance_type_name})
157+
)
157158

158159
assert len(instance_types) == 1
159160
return instance_types[0]

packages/aws-library/tests/test_s3_client.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1133,14 +1133,13 @@ async def test_create_multipart_presigned_upload_link(
11331133
assert s3_metadata.last_modified
11341134
assert s3_metadata.e_tag == f"{json.loads(received_e_tag)}"
11351135

1136-
# completing again raises
1137-
with pytest.raises(S3UploadNotFoundError):
1138-
await simcore_s3_api.complete_multipart_upload(
1139-
bucket=with_s3_bucket,
1140-
object_key=file_id,
1141-
upload_id=upload_links.upload_id,
1142-
uploaded_parts=uploaded_parts,
1143-
)
1136+
# completing again does not raise anymore (was raising until moto==5.0.21)
1137+
await simcore_s3_api.complete_multipart_upload(
1138+
bucket=with_s3_bucket,
1139+
object_key=file_id,
1140+
upload_id=upload_links.upload_id,
1141+
uploaded_parts=uploaded_parts,
1142+
)
11441143

11451144

11461145
@pytest.mark.parametrize(

0 commit comments

Comments
 (0)