Skip to content

Commit 581f592

Browse files
committed
updated
1 parent c0fd922 commit 581f592

File tree

3 files changed

+23
-5
lines changed

3 files changed

+23
-5
lines changed

Makefile

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
all: install test
1+
all: install test
22

33
release:
44
mkrelease -p -d pypi
@@ -16,3 +16,10 @@ test:
1616
sleep 30
1717
FS_WEBDAV_URL=http://admin:admin@localhost:10080/exist/webdav/db bin/nosetests -v webdavfs
1818

19+
test-basex:
20+
bin/pip install nose
21+
/usr/bin/python -c "import os; os.system('docker rm -f basex')"
22+
docker run -d -p 127.0.0.1:10081:8080 --name basex zopyx/basex-86
23+
sleep 10
24+
FS_WEBDAV_URL=http://admin:admin@localhost:10081/webdav/ bin/nosetests -v webdavfs
25+

webdavfs/tests/test_webdavfs.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from __future__ import unicode_literals
22

3+
import uuid
34
import furl
45
import json
56
import os
@@ -16,13 +17,23 @@
1617
class TestWebDAVFS(FSTestCases, unittest.TestCase):
1718
"""Test WebDAVFS implementation."""
1819

20+
21+
def __init__(self, *args, **kw):
22+
self.test_root = unicode(uuid.uuid4())
23+
super(TestWebDAVFS, self).__init__(*args, **kw)
24+
1925
def make_fs(self):
2026

2127
f = furl.furl(webdav_url)
2228
url = '{0}://{1}:{2}'.format(f.scheme, f.host, f.port)
2329
creds = {'login': f.username, 'password': f.password}
2430
root = str(f.path)
25-
return webdavfs.WebDAVFS(url, creds, root)
31+
handle = webdavfs.WebDAVFS(url, creds, root)
32+
if handle.exists(self.test_root):
33+
handle.rmdir(self.test_root, recursive=True)
34+
handle.makedir(self.test_root)
35+
handle = webdavfs.WebDAVFS(url, creds, root + '/' + self.test_root)
36+
return handle
2637

2738
def destroy_fs(self, fs):
2839
for item in fs.client.list('/'):

webdavfs/tests/tests_common.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
from nose.plugins.attrib import attr
1313

14-
webdav_url = os.environ.get('FS_WEBDAV_URL', 'http://admin:[email protected]:20082/exist/webdav/db')
14+
webdav_url = os.environ.get('FS_WEBDAV_URL', 'http://admin:[email protected]:22082/exist/webdav/db')
1515

1616
@attr('slow')
1717
class TestWebDAVFS(unittest.TestCase):
@@ -36,7 +36,7 @@ def make_fs(self):
3636

3737
def test_directories_mkdir_removedir(self):
3838
fs = self.make_fs()
39-
for i in range(10):
39+
for i in range(5):
4040
fs.makedir(unicode(i))
41-
for i in range(10):
41+
for i in range(5):
4242
fs.removedir(unicode(i))

0 commit comments

Comments
 (0)