diff --git a/tests/storage/__init__.py b/tests/storage/__init__.py index 5165f9a..3fc283b 100644 --- a/tests/storage/__init__.py +++ b/tests/storage/__init__.py @@ -71,7 +71,9 @@ class StorageTests(object): assert_item_equals(s.get(href)[0], item) new_item = self._create_bogus_item() - s.update(href, new_item, etag) + new_etag = s.update(href, new_item, etag) + # See https://github.com/untitaker/vdirsyncer/issues/48 + assert isinstance(new_etag, (bytes, text_type)) assert_item_equals(s.get(href)[0], new_item) def test_update_nonexisting(self): diff --git a/vdirsyncer/storage/dav.py b/vdirsyncer/storage/dav.py index e5467e7..9b6782b 100644 --- a/vdirsyncer/storage/dav.py +++ b/vdirsyncer/storage/dav.py @@ -217,7 +217,8 @@ class DavStorage(Storage): href = self._normalize_href(href) if etag is None: raise ValueError('etag must be given and must not be None.') - return self._put(href, item, etag) + href, etag = self._put(href, item, etag) + return etag def upload(self, item): href = self._get_href(item) diff --git a/vdirsyncer/sync.py b/vdirsyncer/sync.py index b2de7c4..31d7fcf 100644 --- a/vdirsyncer/sync.py +++ b/vdirsyncer/sync.py @@ -18,7 +18,7 @@ import itertools from . import exceptions, log -from .utils import iteritems +from .utils import iteritems, text_type sync_logger = log.get(__name__) @@ -152,6 +152,7 @@ def action_update(ident, source, dest): old_etag = dest_list[dest_href]['etag'] item = source_list[source_href]['item'] dest_etag = dest_storage.update(dest_href, item, old_etag) + assert isinstance(dest_etag, (bytes, text_type)) source_status = (source_href, source_etag) dest_status = (dest_href, dest_etag)