mirror of
https://github.com/samsonjs/vdirsyncer.git
synced 2026-04-27 14:57:41 +00:00
Add test for error handling
This commit is contained in:
parent
720174a205
commit
1050a4e157
2 changed files with 10 additions and 0 deletions
|
|
@ -134,6 +134,13 @@ class StorageTests(object):
|
||||||
|
|
||||||
assert not collections
|
assert not collections
|
||||||
|
|
||||||
|
def test_discover_collection_arg(self):
|
||||||
|
args = self.get_storage_args(collection='lol')
|
||||||
|
with pytest.raises(TypeError) as excinfo:
|
||||||
|
list(self.storage_class.discover(**args))
|
||||||
|
|
||||||
|
assert 'collection argument must not be given' in str(excinfo.value)
|
||||||
|
|
||||||
def test_collection_arg(self):
|
def test_collection_arg(self):
|
||||||
s = self.storage_class(**self.get_storage_args(collection='test2'))
|
s = self.storage_class(**self.get_storage_args(collection='test2'))
|
||||||
# Can't do stronger assertion because of radicale, which needs a
|
# Can't do stronger assertion because of radicale, which needs a
|
||||||
|
|
|
||||||
|
|
@ -22,5 +22,8 @@ class TestMemoryStorage(StorageTests):
|
||||||
def test_discover(self):
|
def test_discover(self):
|
||||||
'''This test doesn't make any sense here.'''
|
'''This test doesn't make any sense here.'''
|
||||||
|
|
||||||
|
def test_discover_collection_arg(self):
|
||||||
|
'''This test doesn't make any sense here.'''
|
||||||
|
|
||||||
def test_collection_arg(self):
|
def test_collection_arg(self):
|
||||||
'''This test doesn't make any sense here.'''
|
'''This test doesn't make any sense here.'''
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue