Skip to content

Commit

Permalink
test websocket default
Browse files Browse the repository at this point in the history
  • Loading branch information
xiazhvera committed Jan 2, 2025
1 parent daea066 commit 7c0faec
Showing 1 changed file with 2 additions and 21 deletions.
23 changes: 2 additions & 21 deletions test/test_mqtt.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ def test_websockets_default(self):
region=config.region,
credentials_provider=cred_provider,
endpoint=config.endpoint,
client_id='test-test-websockets-default-{0}'.format(uuid.uuid4()),
client_id='test-websockets-default-{0}'.format(uuid.uuid4()),
client_bootstrap=bootstrap)
self._test_connection(connection)

Expand All @@ -156,26 +156,7 @@ def test_websockets_sts(self):
region=config.region,
credentials_provider=cred_provider,
endpoint=config.endpoint,
client_id='test-test-websockets-sts-{0}'.format(uuid.uuid4()),
client_bootstrap=bootstrap)
self._test_connection(connection)

def test_websockets_cognito(self):
"""Websocket connection with X-Amz-Security-Token query param"""
config = Config.get()
elg = EventLoopGroup()
resolver = DefaultHostResolver(elg)
bootstrap = ClientBootstrap(elg, resolver)
cognito_endpoint = f"cognito-identity.{config.region}.amazonaws.com"
cred_provider = AwsCredentialsProvider.new_cognito(
endpoint=cognito_endpoint,
identity=config.cognito_id,
tls_ctx=ClientTlsContext(TlsContextOptions()))
connection = mqtt_connection_builder.websockets_with_default_aws_signing(
region=config.region,
credentials_provider=cred_provider,
endpoint=config.endpoint,
client_id='test-websockets-cognito-{0}'.format(uuid.uuid4()),
client_id=create_client_id(),
client_bootstrap=bootstrap)
self._test_connection(connection)

Expand Down

0 comments on commit 7c0faec

Please sign in to comment.