Skip to content

Commit

Permalink
Merge pull request #1151 from jakob-keller/test-invalid-endpoint-url
Browse files Browse the repository at this point in the history
Test invalid `endpoint_url`
  • Loading branch information
jakob-keller committed Aug 18, 2024
2 parents 33c6293 + 6bdbf2f commit 11f14dd
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/test_endpoint.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import pytest


@pytest.mark.moto
@pytest.mark.asyncio
async def test_invalid_endpoint_url(session, region):
endpoint_url = 'invalid_url'
with pytest.raises(ValueError, match=f'Invalid endpoint: {endpoint_url}'):
async with session.create_client(
'ec2', region_name=region, endpoint_url=endpoint_url
):
raise AssertionError # should not succeed in entering client context

0 comments on commit 11f14dd

Please sign in to comment.