예제 #1
0
class TestTahoeFS(unittest.TestCase,FSTestCases,ThreadingTestCases):

    #  Disabled by default because it takes a *really* long time.
    __test__ = False

    def setUp(self):
        self.dircap = TahoeFS.createdircap(WEBAPI)
        self.fs = TahoeFS(self.dircap, timeout=0, webapi=WEBAPI)
             
    def tearDown(self):
        self.fs.close()
         
    def test_dircap(self):
        # Is dircap in correct format?
        self.assert_(self.dircap.startswith('URI:DIR2:') and len(self.dircap) > 50)
     
    def test_concurrent_copydir(self):
        #  makedir() on TahoeFS is currently not atomic
        pass

    def test_makedir_winner(self):
        #  makedir() on TahoeFS is currently not atomic
        pass
    
    def test_big_file(self):
        pass
예제 #2
0
 def get_fs(cls, registry, fs_name, fs_name_params, fs_path, writeable, create_dir):
     from fs.contrib.tahoefs import TahoeFS
     
     if '/uri/' not in fs_path:
         raise OpenerError("""Tahoe url should be in the form <url>/uri/<dicap>""")
     
     url, dircap = fs_path.split('/uri/')
     path = ''
     if '/' in dircap:
         dircap, path = dircap.split('/', 1)
     
     fs = TahoeFS(dircap, webapi=url)
     
     if '/' in path:
         dirname, resourcename = pathsplit(path)
         if createdir:
             fs = fs.makeopendir(dirname)
         else:
             fs = fs.opendir(dirname)
         path = ''
     
     return fs, path        
예제 #3
0
 def setUp(self):
     self.dircap = TahoeFS.createdircap(WEBAPI)
     self.fs = TahoeFS(self.dircap, timeout=0, webapi=WEBAPI)