fix(contacts): address PR #876 round-2 nits

- Drop the redundant `.rstrip("/")` in `_list_object_names`; the
  `endswith("/")` guard already excludes the collection entry.
- Remove the now-unused `_get_raw_vcard` (update_contact resolves the name
  itself and calls `_fetch_raw_vcard` directly). Its only remaining caller —
  the create→read integration test — now calls `_fetch_raw_vcard` with the
  deterministic `<uid>.vcf`, saving a redundant PROPFIND.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Chris Coutinho
2026-06-08 01:52:54 +02:00
co-authored by Claude Opus 4.8
parent 011356cca2
commit 746abba18c
2 changed files with 13 additions and 14 deletions
@@ -167,8 +167,10 @@ async def test_create_contact_persists_all_documented_fields(
contact_data=contact_data,
)
try:
raw_vcard, _etag = await nc_client.contacts._get_raw_vcard(
addressbook_name, contact_uid
# create_contact always writes <uid>.vcf, so fetch that object directly
# (no PROPFIND resolution needed for a contact we just created).
raw_vcard, _etag = await nc_client.contacts._fetch_raw_vcard(
addressbook_name, f"{contact_uid}.vcf"
)
assert "FN:Full Field User" in raw_vcard
assert "EMAIL" in raw_vcard and "full@example.com" in raw_vcard