Skip to content

Commit

Permalink
fix unit test and pin ruff to exact version
Browse files Browse the repository at this point in the history
Signed-off-by: Lance Drane <[email protected]>
  • Loading branch information
Lance-Drane committed Sep 10, 2024
1 parent 51ba9a8 commit 2884001
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 23 deletions.
40 changes: 20 additions & 20 deletions pdm.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ docs = [
[tool.pdm.dev-dependencies]
lint = [
"pre-commit>=3.3.1",
"ruff>=0.5.7",
"ruff==0.5.7",
"mypy>=1.10.0",
"types-paho-mqtt>=1.6.0.20240106",
]
Expand Down
12 changes: 10 additions & 2 deletions tests/unit/test_base_capability_implementation.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ def create_external_request(
self,
request: IntersectDirectMessageParams,
response_handler: INTERSECT_SERVICE_RESPONSE_CALLBACK_TYPE | None = None,
timeout: float = 300.0,
) -> UUID:
request_id = uuid4()
self.registered_requests[request_id] = (request, response_handler)
Expand Down Expand Up @@ -160,9 +161,16 @@ def mock_request_flow(self, fake_request_value: str) -> UUID:
payload=fake_request_value,
),
self._mock_other_service_callback,
300.0,
)[0]

def _mock_other_service_callback(self, param: INTERSECT_SERVICE_RESPONSE_CALLBACK_TYPE):
def _mock_other_service_callback(
self,
_source: str,
_operation: str,
_has_error: bool,
param: INTERSECT_SERVICE_RESPONSE_CALLBACK_TYPE,
):
self.tracked_responses.append(param)

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

# mock calling the response handler
res('pong')
res('fake.fake.fake.fake.fake', 'Fake.fake', False, 'pong')
assert len(capability.tracked_responses) == 1
assert capability.tracked_responses[0] == 'pong'

0 comments on commit 2884001

Please sign in to comment.