Skip to content

Commit b8fc0dd

Browse files
Copilotgonzalocasas
andcommitted
Fix remaining lint and style issues
Co-authored-by: gonzalocasas <933277+gonzalocasas@users.noreply.github.com>
1 parent 60f32ed commit b8fc0dd

File tree

4 files changed

+21
-20
lines changed

4 files changed

+21
-20
lines changed

src/compas_eve/codecs.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424

2525
try:
2626
import compas_pb
27+
2728
COMPAS_PB_AVAILABLE = True
2829
except ImportError:
2930
COMPAS_PB_AVAILABLE = False

src/compas_eve/memory/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@ class InMemoryTransport(Transport, EventEmitterMixin):
2727
"""In-Memory transport is ideal for simple single-process apps and testing.
2828
2929
It will only distribute messages within the same process, not across different processes.
30-
30+
3131
Parameters
3232
----------
3333
codec : :class:`MessageCodec`, optional
34-
The codec to use for encoding and decoding messages.
34+
The codec to use for encoding and decoding messages.
3535
If not provided, defaults to :class:`JsonMessageCodec`.
3636
"""
3737

src/compas_eve/mqtt/mqtt_paho.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class MqttTransport(Transport, EventEmitterMixin):
2525
client_id : str, optional
2626
Client ID for the MQTT connection. If not provided, a unique ID will be generated.
2727
codec : :class:`MessageCodec`, optional
28-
The codec to use for encoding and decoding messages.
28+
The codec to use for encoding and decoding messages.
2929
If not provided, defaults to :class:`JsonMessageCodec`.
3030
"""
3131

tests/unit/test_mqtt_paho_compatibility.py

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,23 @@
44

55

66
def test_paho_mqtt_v1_compatibility():
7-
with patch("compas_eve.mqtt.mqtt_paho.PAHO_MQTT_V2_AVAILABLE", False), patch(
8-
"paho.mqtt.client.Client"
9-
) as mock_client_class:
10-
11-
mock_client = Mock()
12-
mock_client_class.return_value = mock_client
13-
14-
# This should work as if paho-mqtt 1.x is installed
15-
transport = MqttTransport("localhost")
16-
17-
# Should have called mqtt.Client() with client_id parameter only (no callback_api_version)
18-
mock_client_class.assert_called_once()
19-
call_args = mock_client_class.call_args
20-
assert "client_id" in call_args.kwargs
21-
assert call_args.kwargs["client_id"].startswith("compas_eve_")
22-
assert "callback_api_version" not in call_args.kwargs
23-
assert transport.client == mock_client
7+
with patch("compas_eve.mqtt.mqtt_paho.PAHO_MQTT_V2_AVAILABLE", False), patch(
8+
"paho.mqtt.client.Client"
9+
) as mock_client_class:
10+
11+
mock_client = Mock()
12+
mock_client_class.return_value = mock_client
13+
14+
# This should work as if paho-mqtt 1.x is installed
15+
transport = MqttTransport("localhost")
16+
17+
# Should have called mqtt.Client() with client_id parameter only (no callback_api_version)
18+
mock_client_class.assert_called_once()
19+
call_args = mock_client_class.call_args
20+
assert "client_id" in call_args.kwargs
21+
assert call_args.kwargs["client_id"].startswith("compas_eve_")
22+
assert "callback_api_version" not in call_args.kwargs
23+
assert transport.client == mock_client
2424

2525

2626
def test_paho_mqtt_v2_compatibility():

0 commit comments

Comments
 (0)