MCPcopy
hub / github.com/pimutils/vdirsyncer / update

Method update

vdirsyncer/storage/memory.py:51–60  ·  view source on GitHub ↗
(self, href, item, etag)

Source from the content-addressed store, hash-verified

49 return href, etag
50
51 def update(self, href, item, etag):
52 if href not in self.items:
53 raise exceptions.NotFoundError(href)
54 actual_etag, _ = self.items[href]
55 if etag != actual_etag:
56 raise exceptions.WrongEtagError(etag, actual_etag)
57
58 new_etag = _random_string()
59 self.items[href] = (new_etag, item)
60 return new_etag
61
62 def delete(self, href, etag):
63 if not self.has(href):

Callers 8

test_upload_and_updateFunction · 0.95
test_insert_hashFunction · 0.95
test_updated_and_deletedFunction · 0.95
test_changed_uidsFunction · 0.95
test_ident_conflictFunction · 0.95
test_bogus_etag_changeFunction · 0.95

Calls 1

_random_stringFunction · 0.85

Tested by 8

test_upload_and_updateFunction · 0.76
test_insert_hashFunction · 0.76
test_updated_and_deletedFunction · 0.76
test_changed_uidsFunction · 0.76
test_ident_conflictFunction · 0.76
test_bogus_etag_changeFunction · 0.76