class TestTahoeLAFS(unittest.TestCase, FSTestCases):  #,ThreadingTestCases):

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

    def setUp(self):
        self.dircap = TahoeLAFS.createdircap(WEBAPI)
        self.fs = TahoeLAFS(self.dircap, cache_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 TahoeLAFS is currently not atomic
        pass

    def test_makedir_winner(self):
        #  makedir() on TahoeLAFS is currently not atomic
        pass

    def test_big_file(self):
        pass
class TestTahoeLAFS(unittest.TestCase,FSTestCases):#,ThreadingTestCases):

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

    def setUp(self):
        self.dircap = TahoeLAFS.createdircap(WEBAPI)
        print TahoeLAFS.__mro__
        self.fs = TahoeLAFS(self.dircap, cache_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 TahoeLAFS is currently not atomic
        pass

    def test_makedir_winner(self):
        #  makedir() on TahoeLAFS is currently not atomic
        pass
    
    def test_big_file(self):
        pass
Exemple #3
0
    def get_fs(cls, registry, fs_name, fs_name_params, fs_path, writeable, create_dir):
        from fs.contrib.tahoelafs import TahoeLAFS

        if '/uri/' not in fs_path:
            raise OpenerError("""Tahoe-LAFS 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 = TahoeLAFS(dircap, webapi=url)

        if '/' in path:
            dirname, _resourcename = pathsplit(path)
            if create_dir:
                fs = fs.makeopendir(dirname)
            else:
                fs = fs.opendir(dirname)
            path = ''

        return fs, path
Exemple #4
0
 def get_fs(cls, registry, fs_name, fs_name_params, fs_path, writeable, create_dir):
     from fs.contrib.tahoelafs import TahoeLAFS
     
     if '/uri/' not in fs_path:
         raise OpenerError("""Tahoe-LAFS 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 = TahoeLAFS(dircap, webapi=url)
     
     if '/' in path:
         dirname, _resourcename = pathsplit(path)
         if create_dir:
             fs = fs.makeopendir(dirname)
         else:
             fs = fs.opendir(dirname)
         path = ''
     
     return fs, path        
 def setUp(self):
     self.dircap = TahoeLAFS.createdircap(WEBAPI)
     self.fs = TahoeLAFS(self.dircap, cache_timeout=0, webapi=WEBAPI)
 def setUp(self):
     self.dircap = TahoeLAFS.createdircap(WEBAPI)
     print TahoeLAFS.__mro__
     self.fs = TahoeLAFS(self.dircap, cache_timeout=0, webapi=WEBAPI)