From 4be5a767fd4101250cd55d10da894b9d760dc052 Mon Sep 17 00:00:00 2001 From: meejah Date: Mon, 8 Jul 2019 14:00:11 -0600 Subject: [PATCH] bytes, prefixes --- src/allmydata/test/test_introducer.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/allmydata/test/test_introducer.py b/src/allmydata/test/test_introducer.py index f9fa04557..173574c48 100644 --- a/src/allmydata/test/test_introducer.py +++ b/src/allmydata/test/test_introducer.py @@ -495,8 +495,7 @@ class SystemTest(SystemTestMixin, AsyncTestCase): if i < NUM_STORAGE: # sign all announcements c.publish("storage", make_ann(node_furl), private_key) - assert public_key_str.startswith("pub-") - printable_serverids[i] = public_key_str[len("pub-"):] + printable_serverids[i] = remove_prefix(public_key_str, b"pub-") publishing_clients.append(c) else: # the last one does not publish anything @@ -1014,8 +1013,7 @@ class Signatures(SyncTestCase): unsign_from_foolscap, (bad_msg, sig, "v999-key")) def test_unsigned_announcement(self): - from allmydata.crypto import ed25519 - ed25519.verifying_key_from_string("pub-v0-wodst6ly4f7i7akt2nxizsmmy2rlmer6apltl56zctn67wfyu5tq") + ed25519.verifying_key_from_string(b"pub-v0-wodst6ly4f7i7akt2nxizsmmy2rlmer6apltl56zctn67wfyu5tq") mock_tub = Mock() ic = IntroducerClient( mock_tub,