test(projekt-matching): e2e helper scripts; component gates verified

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
tlg
2026-07-09 15:49:08 +02:00
parent cef4041500
commit 53b5de28bc
3 changed files with 67 additions and 0 deletions

View File

@@ -0,0 +1,19 @@
#!/usr/bin/env python3
"""Delete test opportunities whose cProjektlink contains a token."""
import os
import sys
sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..", ".."))
from projektmatch.espocrm import EspoClient # noqa: E402
TOKENS = sys.argv[1:] or [
"python-entwickler-fuer-eine-ki-anwendung",
"test-engineer-m-w-d-3020995",
"nproj/3020338", "nproj/3020995"]
espo = EspoClient(os.environ["PM_ESPO_BASE"], os.environ["PM_ESPO_API_KEY"])
for token in TOKENS:
for hit in espo.search("Opportunity", "contains", "cProjektlink", token,
select="name,cProjektlink", max_size=100):
espo.delete("Opportunity", hit["id"])
print(f"deleted {hit['id']} {hit['name']}")
print("cleanup done")