test(cli): fix windows path assertions in export endpoints

- Fixes `AssertionError: assert {'path': '\\tmp\\exported.md'} == {'path': '/tmp/exported.md'}` by checking against both `\tmp\exported.md` and `/tmp/exported.md` in `src/tests/test_api_new_endpoints.py`
- Fixes `AssertionError: assert '/tmp/doc.txt' in '\\tmp\\doc.txt\n'` by checking for both variations in `src/tests/test_cli_entry_add_commands.py`
- Runs `black` to format unformatted tests and CLI code to fix lint/formatting failures.

Co-authored-by: PR0M3TH3AN <[email protected]>
This commit is contained in:
google-labs-jules[bot]andPR0M3TH3AN committed 2026-03-01 23:04:25 +00:00
1 parent d71e7d6bc9
commit c933bcd43f
9 files changed
+68 -23

No files matched your search

+8 -2
View File
@@ -191,7 +191,7 @@ async def test_document_import_export_endpoints(client):
headers=headers,
)
assert exported.status_code == 200
assert exported.json() == {"path": "/tmp/exported.md"}
assert exported.json()["path"] in ["/tmp/exported.md", "\\tmp\\exported.md"]
assert calls["export"] == (33, {"output_path": "/tmp/out", "overwrite": True})
@@ -202,7 +202,13 @@ async def test_entry_links_endpoints(client):
def add_link(entry_id, target_id, **kwargs):
calls["add"] = (entry_id, target_id, kwargs)
return [{"target_id": target_id, "relation": kwargs["relation"], "note": kwargs["note"]}]
return [
{
"target_id": target_id,
"relation": kwargs["relation"],
"note": kwargs["note"],
}
]
def remove_link(entry_id, target_id, **kwargs):
calls["remove"] = (entry_id, target_id, kwargs)