Add test for error handling

This commit is contained in:
Markus Unterwaditzer 2014-04-13 10:09:06 +02:00
parent 720174a205
commit 1050a4e157
2 changed files with 10 additions and 0 deletions

View file

@ -134,6 +134,13 @@ class StorageTests(object):
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):
s = self.storage_class(**self.get_storage_args(collection='test2'))
# Can't do stronger assertion because of radicale, which needs a

View file

@ -22,5 +22,8 @@ class TestMemoryStorage(StorageTests):
def test_discover(self):
'''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):
'''This test doesn't make any sense here.'''