Fix test_add_rref users by making them supply coherent values

... of the right type
This commit is contained in:
Jean-Paul Calderone 2019-06-28 14:50:46 -04:00
parent 166c5ab53f
commit 11418a9f87
2 changed files with 9 additions and 4 deletions

View File

@ -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

View File

@ -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)