Skip to content

Commit 2884001

Browse files
committed
fix unit test and pin ruff to exact version
Signed-off-by: Lance Drane <dranelt@ornl.gov>
1 parent 51ba9a8 commit 2884001

File tree

3 files changed

+31
-23
lines changed

3 files changed

+31
-23
lines changed

pdm.lock

Lines changed: 20 additions & 20 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ docs = [
5454
[tool.pdm.dev-dependencies]
5555
lint = [
5656
"pre-commit>=3.3.1",
57-
"ruff>=0.5.7",
57+
"ruff==0.5.7",
5858
"mypy>=1.10.0",
5959
"types-paho-mqtt>=1.6.0.20240106",
6060
]

tests/unit/test_base_capability_implementation.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ def create_external_request(
3333
self,
3434
request: IntersectDirectMessageParams,
3535
response_handler: INTERSECT_SERVICE_RESPONSE_CALLBACK_TYPE | None = None,
36+
timeout: float = 300.0,
3637
) -> UUID:
3738
request_id = uuid4()
3839
self.registered_requests[request_id] = (request, response_handler)
@@ -160,9 +161,16 @@ def mock_request_flow(self, fake_request_value: str) -> UUID:
160161
payload=fake_request_value,
161162
),
162163
self._mock_other_service_callback,
164+
300.0,
163165
)[0]
164166

165-
def _mock_other_service_callback(self, param: INTERSECT_SERVICE_RESPONSE_CALLBACK_TYPE):
167+
def _mock_other_service_callback(
168+
self,
169+
_source: str,
170+
_operation: str,
171+
_has_error: bool,
172+
param: INTERSECT_SERVICE_RESPONSE_CALLBACK_TYPE,
173+
):
166174
self.tracked_responses.append(param)
167175

168176
# setup
@@ -178,6 +186,6 @@ def _mock_other_service_callback(self, param: INTERSECT_SERVICE_RESPONSE_CALLBAC
178186
assert req.payload == body
179187

180188
# mock calling the response handler
181-
res('pong')
189+
res('fake.fake.fake.fake.fake', 'Fake.fake', False, 'pong')
182190
assert len(capability.tracked_responses) == 1
183191
assert capability.tracked_responses[0] == 'pong'

0 commit comments

Comments
 (0)