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

Method test_update

tests/storage/__init__.py:114–127  ·  view source on GitHub ↗
(self, s, get_item)

Source from the content-addressed store, hash-verified

112 assert_item_equals(s.get(href)[0], item)
113
114 def test_update(self, s, get_item):
115 item = get_item()
116 href, etag = s.upload(item)
117 if etag is None:
118 _, etag = s.get(href)
119 assert_item_equals(s.get(href)[0], item)
120
121 new_item = get_item(uid=item.uid)
122 new_etag = s.update(href, new_item, etag)
123 if new_etag is None:
124 _, new_etag = s.get(href)
125 # See https://github.com/pimutils/vdirsyncer/issues/48
126 assert isinstance(new_etag, (bytes, str))
127 assert_item_equals(s.get(href)[0], new_item)
128
129 def test_update_nonexisting(self, s, get_item):
130 item = get_item()

Callers

nothing calls this directly

Calls 4

assert_item_equalsFunction · 0.85
uploadMethod · 0.45
getMethod · 0.45
updateMethod · 0.45

Tested by

no test coverage detected