More fixes for owncloud

This commit is contained in:
Markus Unterwaditzer 2014-03-18 17:13:40 +01:00
parent a1e3ff7fbb
commit f341c4a294
4 changed files with 10 additions and 7 deletions

View file

@ -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 $@

View file

@ -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])

View file

@ -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',

View file

@ -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):