summaryrefslogtreecommitdiff
path: root/fs/contrib/tahoelafs/test_tahoelafs.py
blob: 5cb6ca70a69ef9b596f31324610961f8ef68de09 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/usr/bin/python
"""
    Test the TahoeLAFS

    @author: Marek Palatinus <marek@palatinus.cz>
"""

import sys
import logging
import unittest

from fs.base import FS
import fs.errors as errors
from fs.tests import FSTestCases, ThreadingTestCases
from fs.contrib.tahoelafs import TahoeLAFS, Connection

logging.getLogger().setLevel(logging.DEBUG)
logging.getLogger('fs.tahoelafs').addHandler(logging.StreamHandler(sys.stdout))

WEBAPI = 'http://insecure.tahoe-lafs.org'


#  The public grid is too slow for threading testcases, disabling for now...
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

if __name__ == '__main__':
    unittest.main()