Skip to content

Commit

Permalink
feat: Restructured pilot logger + test send_message and get_logs
Browse files Browse the repository at this point in the history
  • Loading branch information
martynia committed Jan 16, 2025
1 parent 5bf8143 commit 00ef8ed
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion diracx-routers/tests/pilots/test_pilot_logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,13 @@
from diracx.routers.utils.users import AuthSettings

pytestmark = pytest.mark.enabled_dependencies(
["AuthSettings", "PilotAgentsDB", "PilotLogsDB"]
[
"AuthSettings",
"PilotAgentsDB",
"PilotLogsDB",
"PilotLogsAccessPolicy",
"DevelopmentSettings",
]
)


Expand Down Expand Up @@ -49,3 +55,9 @@ async def test_send_and_retrieve_logs(
r = normal_user_client.post("/api/pilots/", json=msg_dict)

assert r.status_code == 200, r.text
# it just returns the pilot id corresponding for pilot stamp.
assert r.json() == 1
# get the message back:
r = normal_user_client.get("/api/pilots/logs?pilot_id=1")
assert r.status_code == 200, r.text
assert [next(iter(d.values())) for d in r.json()] == msg.split("\n")

0 comments on commit 00ef8ed

Please sign in to comment.