diff --git a/run-tests.sh b/run-tests.sh index 046fb68..fb3f78d 100644 --- a/run-tests.sh +++ b/run-tests.sh @@ -10,8 +10,7 @@ davserver_owncloud() { } +# while it would be nice if the server was cleanly shut down, it's not really a +# problem either davserver_$DAV_SERVER & -DAVSERVER_PID=$! -py.test ./tests/ -kill -9 $DAVSERVER_PID -wait +py.test $@ diff --git a/tests/storage/__init__.py b/tests/storage/__init__.py index 38e24c9..90646fb 100644 --- a/tests/storage/__init__.py +++ b/tests/storage/__init__.py @@ -98,7 +98,8 @@ class StorageTests(object): def test_discover(self): items = [] for i in range(4): - s = self.storage_class(**self.get_storage_args(collection='test' + str(i+1))) + i += 1 + s = self.storage_class(**self.get_storage_args(collection='test' + str(i))) items.append(self._create_bogus_item(str(i))) s.upload(items[-1]) diff --git a/tests/storage/dav/_owncloud.py b/tests/storage/dav/_owncloud.py index a9ce3ae..b059d65 100644 --- a/tests/storage/dav/_owncloud.py +++ b/tests/storage/dav/_owncloud.py @@ -23,12 +23,13 @@ class ServerMixin(object): subprocess.call([os.path.join(owncloud_repo, 'install.sh')]) def get_storage_args(self, collection='test'): - assert self.storage_class.fileext in ('.ics', '.vcf') url = 'http://127.0.0.1:8080' if self.storage_class.fileext == '.vcf': url += '/remote.php/carddav/addressbooks/asdf/' - else: + elif self.storage_class.fileext == '.ics': url += '/remote.php/carddav/addressbooks/asdf/' + else: + raise RuntimeError(self.storage_class.fileext) if collection is not None: # the following collections are setup in ownCloud assert collection in ('test', 'test1', 'test2', 'test3', 'test4', diff --git a/vdirsyncer/storage/dav/base.py b/vdirsyncer/storage/dav/base.py index 9e57aca..d7a9c4e 100644 --- a/vdirsyncer/storage/dav/base.py +++ b/vdirsyncer/storage/dav/base.py @@ -232,6 +232,8 @@ class DavStorage(Storage): href, headers=headers ) + if response.status_code == 404: + raise exceptions.NotFoundError(href) self._check_response(response) def _list(self, xml):