From 11418a9f878e6bbea7dd65a9c572c4a06514ceb4 Mon Sep 17 00:00:00 2001 From: Jean-Paul Calderone Date: Fri, 28 Jun 2019 14:50:46 -0400 Subject: [PATCH] Fix test_add_rref users by making them supply coherent values ... of the right type --- src/allmydata/storage_client.py | 5 ++++- src/allmydata/test/mutable/util.py | 8 +++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/allmydata/storage_client.py b/src/allmydata/storage_client.py index 7e94a7520..1e9b5fba8 100644 --- a/src/allmydata/storage_client.py +++ b/src/allmydata/storage_client.py @@ -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 diff --git a/src/allmydata/test/mutable/util.py b/src/allmydata/test/mutable/util.py index 89d2269f3..115bc3b77 100644 --- a/src/allmydata/test/mutable/util.py +++ b/src/allmydata/test/mutable/util.py @@ -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)