From d98c4b37bae447c7cbaecc80c09721074b04257d Mon Sep 17 00:00:00 2001 From: Markus Unterwaditzer Date: Thu, 19 Jun 2014 18:09:25 +0200 Subject: [PATCH] Cheap shots for test coverage --- tests/storage/test_singlefile.py | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/tests/storage/test_singlefile.py b/tests/storage/test_singlefile.py index 51744e5..47769f9 100644 --- a/tests/storage/test_singlefile.py +++ b/tests/storage/test_singlefile.py @@ -33,8 +33,20 @@ class TestSingleFileStorage(StorageTests): 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.''' + def test_collection_arg(self, tmpdir): + with pytest.raises(ValueError): + self.storage_class(str(tmpdir.join('foo.ics')), collection='ha') + + def test_create_arg(self, tmpdir): + s = self.storage_class(str(tmpdir) + '/foo.ics') + assert not s.list() + + s.create = False + with pytest.raises(IOError): + s.list() + + with pytest.raises(IOError): + s = self.storage_class(str(tmpdir) + '/foo.ics', create=False) def test_update(self): '''The original testcase tries to fetch with the old href. But this