コード例 #1
0
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
コード例 #2
0
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
コード例 #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
コード例 #4
0
ファイル: opener.py プロジェクト: pombreda/agilepyfs
 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        
コード例 #5
0
 def setUp(self):
     self.dircap = TahoeLAFS.createdircap(WEBAPI)
     self.fs = TahoeLAFS(self.dircap, cache_timeout=0, webapi=WEBAPI)
コード例 #6
0
 def setUp(self):
     self.dircap = TahoeLAFS.createdircap(WEBAPI)
     print TahoeLAFS.__mro__
     self.fs = TahoeLAFS(self.dircap, cache_timeout=0, webapi=WEBAPI)