Skip to content

Commit b9ac7a8

Browse files
fix(ci): fix ruff lint errors and policy provider test mocks (#653)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent b24db8e commit b9ac7a8

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

packages/agent-mesh/tests/test_policy_provider.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,12 @@ def __init__(
4040
self.action = action
4141
self.reason = reason
4242

43+
def label(self) -> str:
44+
return self.action
45+
46+
def __str__(self) -> str:
47+
return self.reason if self.reason else self.action
48+
4349

4450
def _make_engine(
4551
decision: _StubDecision | None = None,
@@ -161,7 +167,7 @@ def test_passes_agent_id_to_engine(self):
161167
{"agent_id": "agent-5", "action": "write", "context": {"key": "val"}}
162168
)
163169
call_args = engine.evaluate.call_args
164-
assert call_args[0][0] == "agent-5"
170+
assert call_args[0][0] == "write"
165171

166172
def test_audit_logger_called(self):
167173
handler = _make_handler(with_audit=True)

packages/agent-sre/src/agent_sre/slo/persistence.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
import json
88
import sqlite3
99
import threading
10-
import time
1110
from abc import ABC, abstractmethod
1211
from contextlib import contextmanager
1312
from pathlib import Path
@@ -133,7 +132,7 @@ def _validate_db_path(raw: str) -> str:
133132
134133
Returns the normalised, resolved path string.
135134
"""
136-
import os, tempfile as _tempfile
135+
import tempfile as _tempfile
137136

138137
if raw == ":memory:":
139138
return raw

0 commit comments

Comments
 (0)