chore: 502 bei propfind-fail, min_length path, exact-call assertion
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
from unittest.mock import AsyncMock
|
||||
from unittest.mock import AsyncMock, call
|
||||
|
||||
from fastapi.testclient import TestClient
|
||||
|
||||
from app.webhook.models import EventType
|
||||
|
||||
|
||||
def _make_app(monkeypatch):
|
||||
monkeypatch.setenv("NEXTCLOUD_WEBDAV_URL", "http://nc")
|
||||
@@ -45,6 +48,13 @@ def test_bulk_import_lists_and_dispatches(monkeypatch):
|
||||
assert r.status_code == 202
|
||||
body = r.json()
|
||||
assert body["dispatched"] == 2 # only .pdf and .docx, not the json sidecar
|
||||
process_mock.assert_has_calls(
|
||||
[
|
||||
call("Documents/THB/Studium/2.Semester/Databases/a.pdf", EventType.CREATED),
|
||||
call("Documents/THB/Studium/2.Semester/Databases/b.docx", EventType.CREATED),
|
||||
]
|
||||
)
|
||||
assert process_mock.await_count == 2
|
||||
|
||||
|
||||
def test_bulk_import_rejects_wrong_secret(monkeypatch):
|
||||
|
||||
Reference in New Issue
Block a user