mirror of
https://github.com/samsonjs/vdirsyncer.git
synced 2026-04-26 14:47:44 +00:00
More fixes for owncloud
This commit is contained in:
parent
a1e3ff7fbb
commit
f341c4a294
4 changed files with 10 additions and 7 deletions
|
|
@ -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_$DAV_SERVER &
|
||||||
DAVSERVER_PID=$!
|
py.test $@
|
||||||
py.test ./tests/
|
|
||||||
kill -9 $DAVSERVER_PID
|
|
||||||
wait
|
|
||||||
|
|
|
||||||
|
|
@ -98,7 +98,8 @@ class StorageTests(object):
|
||||||
def test_discover(self):
|
def test_discover(self):
|
||||||
items = []
|
items = []
|
||||||
for i in range(4):
|
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)))
|
items.append(self._create_bogus_item(str(i)))
|
||||||
s.upload(items[-1])
|
s.upload(items[-1])
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -23,12 +23,13 @@ class ServerMixin(object):
|
||||||
subprocess.call([os.path.join(owncloud_repo, 'install.sh')])
|
subprocess.call([os.path.join(owncloud_repo, 'install.sh')])
|
||||||
|
|
||||||
def get_storage_args(self, collection='test'):
|
def get_storage_args(self, collection='test'):
|
||||||
assert self.storage_class.fileext in ('.ics', '.vcf')
|
|
||||||
url = 'http://127.0.0.1:8080'
|
url = 'http://127.0.0.1:8080'
|
||||||
if self.storage_class.fileext == '.vcf':
|
if self.storage_class.fileext == '.vcf':
|
||||||
url += '/remote.php/carddav/addressbooks/asdf/'
|
url += '/remote.php/carddav/addressbooks/asdf/'
|
||||||
else:
|
elif self.storage_class.fileext == '.ics':
|
||||||
url += '/remote.php/carddav/addressbooks/asdf/'
|
url += '/remote.php/carddav/addressbooks/asdf/'
|
||||||
|
else:
|
||||||
|
raise RuntimeError(self.storage_class.fileext)
|
||||||
if collection is not None:
|
if collection is not None:
|
||||||
# the following collections are setup in ownCloud
|
# the following collections are setup in ownCloud
|
||||||
assert collection in ('test', 'test1', 'test2', 'test3', 'test4',
|
assert collection in ('test', 'test1', 'test2', 'test3', 'test4',
|
||||||
|
|
|
||||||
|
|
@ -232,6 +232,8 @@ class DavStorage(Storage):
|
||||||
href,
|
href,
|
||||||
headers=headers
|
headers=headers
|
||||||
)
|
)
|
||||||
|
if response.status_code == 404:
|
||||||
|
raise exceptions.NotFoundError(href)
|
||||||
self._check_response(response)
|
self._check_response(response)
|
||||||
|
|
||||||
def _list(self, xml):
|
def _list(self, xml):
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue