Skip to content

Commit

Permalink
Fix code style
Browse files Browse the repository at this point in the history
  • Loading branch information
sfodagain committed Jul 13, 2023
1 parent c1241e4 commit 3ee0e3d
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions test/test_mqtt.py
Original file line number Diff line number Diff line change
Expand Up @@ -436,13 +436,13 @@ def test_connect_disconnect_with_callbacks_unhappy(self):
test_tls_opts = TlsContextOptions.create_client_with_mtls_from_path(test_input_cert, test_input_key)
test_tls = ClientTlsContext(test_tls_opts)

onConnectionFailureFuture = Future()
on_onnection_failure_future = Future()

def on_connection_success_callback(connection, callback_data: OnConnectionSuccessData):
pass

def on_connection_failure_callback(connection, callback_data: OnConnectionFailureData):
onConnectionFailureFuture.set_result({'error': callback_data.error})
on_onnection_failure_future.set_result({'error': callback_data.error})

def on_connection_closed_callback(connection, callback_data: OnConnectionClosedData):
pass
Expand All @@ -462,15 +462,15 @@ def on_connection_closed_callback(connection, callback_data: OnConnectionClosedD
exception_occurred = True
self.assertTrue(exception_occurred, "Exception did not occur when connecting with invalid arguments!")

failureData = onConnectionFailureFuture.result(TIMEOUT)
self.assertTrue(failureData['error'] is not None)
failure_data = on_onnection_failure_future.result(TIMEOUT)
self.assertTrue(failure_data['error'] is not None)

def test_connect_disconnect_with_callbacks_happy_on_resume(self):
# Check that an on_connection_success callback fires on a resumed connection.

# NOTE Since there is no mocked server available on this level, the only sensible approach is to interrupt
# a connection, and wait for it to be resumed automatically. For that, another connection with the same
# client_id connects to the server and then immediately disconnects.
# NOTE Since there is no mocked server available on this abstraction level, the only sensible approach
# is to interrupt a connection, and wait for it to be resumed automatically. For that, another client
# with the same client_id connects to the server and then immediately disconnects.

test_input_endpoint = _get_env_variable("AWS_TEST_MQTT311_IOT_CORE_HOST")
test_input_cert = _get_env_variable("AWS_TEST_MQTT311_IOT_CORE_RSA_CERT")
Expand Down Expand Up @@ -511,7 +511,7 @@ def on_connection_resumed_callback(connection, return_code: ConnectReturnCode, s
def on_connection_success_callback_dup(connection, callback_data: OnConnectionSuccessData):
on_connection_success_future_dup.set_result({})

# Reuse the same client_id to displace the first connection.
# Reuse the same client_id to displace the first client.
connection_dup = self._create_connection(
endpoint=test_input_endpoint,
tls_context=test_tls,
Expand Down

0 comments on commit 3ee0e3d

Please sign in to comment.