mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-01-01 18:56:41 +00:00
Fix test_add_rref users by making them supply coherent values
... of the right type
This commit is contained in:
parent
166c5ab53f
commit
11418a9f87
@ -204,7 +204,10 @@ class StorageFarmBroker(service.MultiService):
|
||||
|
||||
# these two are used in unit tests
|
||||
def test_add_rref(self, serverid, rref, ann):
|
||||
s = self._make_storage_server(serverid, {"ann": ann.copy()})
|
||||
s = self._make_storage_server(
|
||||
serverid.decode("ascii"),
|
||||
{"ann": ann.copy()},
|
||||
)
|
||||
s._rref = rref
|
||||
s._is_connected = True
|
||||
self.servers[serverid] = s
|
||||
|
@ -219,10 +219,12 @@ def make_peer(s, i):
|
||||
|
||||
:rtype: ``Peer``
|
||||
"""
|
||||
peerid = tagged_hash("peerid", "%d" % i)[:20]
|
||||
peerid = base32.b2a(tagged_hash("peerid", "%d" % i)[:20])
|
||||
fss = FakeStorageServer(peerid, s)
|
||||
ann = {"anonymous-storage-FURL": "pb://%s@nowhere/fake" % base32.b2a(peerid),
|
||||
"permutation-seed-base32": base32.b2a(peerid) }
|
||||
ann = {
|
||||
"anonymous-storage-FURL": "pb://%s@nowhere/fake" % (peerid,),
|
||||
"permutation-seed-base32": peerid,
|
||||
}
|
||||
return Peer(peerid=peerid, storage_server=fss, announcement=ann)
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user