This commit is contained in:
Markus Unterwaditzer 2014-03-16 11:47:01 +01:00
parent b3a720be75
commit cd31e66798
4 changed files with 12 additions and 4 deletions

View file

@ -7,7 +7,6 @@
:license: MIT, see LICENSE for more details.
'''
from unittest import TestCase
import pytest
from vdirsyncer.storage.base import Item
from vdirsyncer.storage.memory import MemoryStorage
@ -29,6 +28,7 @@ def test_irrelevant_status():
assert empty_storage(a)
assert empty_storage(b)
def test_missing_status():
a = MemoryStorage()
b = MemoryStorage()
@ -41,6 +41,7 @@ def test_missing_status():
assert a.has('1.txt')
assert b.has('1.txt')
def test_missing_status_and_different_items():
return # TODO
a = MemoryStorage()
@ -54,6 +55,7 @@ def test_missing_status_and_different_items():
assert status
assert_item_equals(a.get('1.txt')[0], b.get('1.txt')[0])
def test_upload_and_update():
a = MemoryStorage()
b = MemoryStorage()
@ -79,6 +81,7 @@ def test_upload_and_update():
sync(a, b, status)
assert_item_equals(b.get('2.txt')[0], item2)
def test_deletion():
a = MemoryStorage()
b = MemoryStorage()
@ -98,6 +101,7 @@ def test_deletion():
sync(a, b, status)
assert not a.has('1.txt') and not b.has('1.txt')
def test_already_synced():
a = MemoryStorage()
b = MemoryStorage()
@ -114,6 +118,7 @@ def test_already_synced():
assert status == old_status
assert a.has('1.txt') and b.has('1.txt')
def test_conflict_resolution_both_etags_new():
a = MemoryStorage()
b = MemoryStorage()
@ -135,6 +140,7 @@ def test_conflict_resolution_both_etags_new():
assert u'UID:1' in n
assert u'ASDASD' in n
def test_conflict_resolution_new_etags_without_changes():
a = MemoryStorage()
b = MemoryStorage()

View file

@ -9,6 +9,7 @@
import vdirsyncer.utils as utils
def test_parse_options():
o = {
'foo': 'yes',

View file

@ -153,7 +153,7 @@ def _main(env, file_cfg):
'''
Syncronize the given pairs. If no pairs are given, all will be
synchronized.
Examples:
`vdirsyncer sync` will sync everything configured.
`vdirsyncer sync bob frank` will sync the pairs "bob" and "frank".

View file

@ -172,8 +172,9 @@ class DavStorage(Storage):
rv.append((href, Item(obj), etag))
try:
hrefs_left.remove(href)
except KeyError as e:
raise KeyError('{} doesn\'t exist in {}'.format(href, hrefs_left))
except KeyError:
raise KeyError('{} doesn\'t exist in {}'
.format(href, hrefs_left))
for href in hrefs_left:
raise exceptions.NotFoundError(href)
return rv