Skip to content

Commit 00ef8ed

Browse files
committed
feat: Restructured pilot logger + test send_message and get_logs
1 parent 5bf8143 commit 00ef8ed

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

diracx-routers/tests/pilots/test_pilot_logger.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,13 @@
66
from diracx.routers.utils.users import AuthSettings
77

88
pytestmark = pytest.mark.enabled_dependencies(
9-
["AuthSettings", "PilotAgentsDB", "PilotLogsDB"]
9+
[
10+
"AuthSettings",
11+
"PilotAgentsDB",
12+
"PilotLogsDB",
13+
"PilotLogsAccessPolicy",
14+
"DevelopmentSettings",
15+
]
1016
)
1117

1218

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

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

0 commit comments

Comments
 (0)