2 from twisted.trial import unittest
3 from allmydata.storage_client import NativeStorageServer
6 class NativeStorageServerWithVersion(NativeStorageServer):
7 def __init__(self,version):
13 class TestNativeStorageServer(unittest.TestCase):
14 def test_get_available_space_new(self):
15 nss = NativeStorageServerWithVersion(
16 { "http://allmydata.org/tahoe/protocols/storage/v1":
17 { "maximum-immutable-share-size": 111,
18 "available-space": 222,
21 self.failUnlessEqual(nss.get_available_space(), 222)
23 def test_get_available_space_old(self):
24 nss = NativeStorageServerWithVersion(
25 { "http://allmydata.org/tahoe/protocols/storage/v1":
26 { "maximum-immutable-share-size": 111,
29 self.failUnlessEqual(nss.get_available_space(), 111)