mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2024-12-20 05:28:04 +00:00
test_storage_client.py: add test_get_available_space_{old,new}.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
This commit is contained in:
parent
b9e0d19944
commit
c0a2af5d69
30
src/allmydata/test/test_storage_client.py
Normal file
30
src/allmydata/test/test_storage_client.py
Normal file
@ -0,0 +1,30 @@
|
||||
|
||||
from twisted.trial import unittest
|
||||
from allmydata.storage_client import NativeStorageServer
|
||||
|
||||
|
||||
class NativeStorageServerWithVersion(NativeStorageServer):
|
||||
def __init__(self,version):
|
||||
self.version=version
|
||||
def get_version(self):
|
||||
return self.version
|
||||
|
||||
|
||||
class TestNativeStorageServer(unittest.TestCase):
|
||||
def test_get_available_space_new(self):
|
||||
nss = NativeStorageServerWithVersion(
|
||||
{ "http://allmydata.org/tahoe/protocols/storage/v1":
|
||||
{ "maximum-immutable-share-size": 111,
|
||||
"available-space": 222,
|
||||
}
|
||||
})
|
||||
self.failUnlessEqual(nss.get_available_space(), 222)
|
||||
|
||||
def test_get_available_space_old(self):
|
||||
nss = NativeStorageServerWithVersion(
|
||||
{ "http://allmydata.org/tahoe/protocols/storage/v1":
|
||||
{ "maximum-immutable-share-size": 111,
|
||||
}
|
||||
})
|
||||
self.failUnlessEqual(nss.get_available_space(), 111)
|
||||
|
Loading…
Reference in New Issue
Block a user