Weise bei einem Paperless-Fehler auf die Kombination aus allen Tags und Zusatzfeld hin, die Paperless selbst mit HTTP 500 beantwortet.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
0f2b7a8fab
commit
ffdaf1c721
2 files changed
+14
-3
No files matched your search
@@ -677,6 +677,13 @@ def test_paperless_refusal_names_the_status_and_reason(monkeypatch):
|
||||
with pytest.raises(Problem) as caught:
|
||||
sources._paperless_get("https://paper.example.test", "token-alpha", "/api/documents/", {})
|
||||
assert caught.value.detail.endswith("(HTTP 500 auf /api/documents/).")
|
||||
with pytest.raises(Problem) as caught:
|
||||
sources._paperless_get("https://paper.example.test", "token-alpha", "/api/documents/", {}, "Hinweis.")
|
||||
assert caught.value.detail.endswith("(HTTP 500 auf /api/documents/). Hinweis.")
|
||||
monkeypatch.setattr(sources, "urlopen", refuse(400, b"{}"))
|
||||
with pytest.raises(Problem) as caught:
|
||||
sources._paperless_get("https://paper.example.test", "token-alpha", "/api/documents/", {}, "Hinweis.")
|
||||
assert "Hinweis" not in caught.value.detail
|
||||
monkeypatch.setattr(sources, "urlopen", refuse(403, b"{}"))
|
||||
with pytest.raises(Problem) as caught:
|
||||
sources._paperless_get("https://paper.example.test", "token-alpha", "/api/documents/", {})
|
||||
|
||||
Reference in new issue
Block a user