File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- all : install test
1+ all : install test
22
33release :
44 mkrelease -p -d pypi
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+
Original file line number Diff line number Diff line change 11from __future__ import unicode_literals
22
3+ import uuid
34import furl
45import json
56import os
1617class 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 ('/' ):
Original file line number Diff line number Diff line change 1111
1212from nose .plugins .attrib import attr
1313
14- webdav_url = os .environ .get ('FS_WEBDAV_URL' , 'http://admin:admin@zopyx.com:20082 /exist/webdav/db' )
14+ webdav_url = os .environ .get ('FS_WEBDAV_URL' , 'http://admin:admin@zopyx.com:22082 /exist/webdav/db' )
1515
1616@attr ('slow' )
1717class 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 ))
You can’t perform that action at this time.
0 commit comments