mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2024-12-24 07:06:41 +00:00
server IDs/node IDS should be bytes.
This commit is contained in:
parent
b5f2afe39c
commit
33392502d3
@ -464,6 +464,7 @@ class StorageFarmBroker(service.MultiService):
|
||||
@implementer(IDisplayableServer)
|
||||
class StubServer(object):
|
||||
def __init__(self, serverid):
|
||||
assert isinstance(serverid, bytes)
|
||||
self.serverid = serverid # binary tubid
|
||||
def get_serverid(self):
|
||||
return self.serverid
|
||||
|
@ -143,12 +143,12 @@ class DownloadStatusElementTests(TrialTestCase):
|
||||
See if we can render the page almost fully.
|
||||
"""
|
||||
status = FakeDownloadStatus(
|
||||
"si-1", 123,
|
||||
["s-1", "s-2", "s-3"],
|
||||
{"s-1": "unknown problem"},
|
||||
{"s-1": [1], "s-2": [1,2], "s-3": [2,3]},
|
||||
b"si-1", 123,
|
||||
[b"s-1", b"s-2", b"s-3"],
|
||||
{b"s-1": "unknown problem"},
|
||||
{b"s-1": [1], b"s-2": [1,2], b"s-3": [2,3]},
|
||||
{"fetch_per_server":
|
||||
{"s-1": [1], "s-2": [2,3], "s-3": [3,2]}}
|
||||
{b"s-1": [1], b"s-2": [2,3], b"s-3": [3,2]}}
|
||||
)
|
||||
|
||||
result = self._render_download_status_element(status)
|
||||
|
@ -261,7 +261,7 @@ class FakeClient(_Client):
|
||||
# minimal subset
|
||||
service.MultiService.__init__(self)
|
||||
self.all_contents = {}
|
||||
self.nodeid = "fake_nodeid"
|
||||
self.nodeid = b"fake_nodeid"
|
||||
self.nickname = u"fake_nickname \u263A"
|
||||
self.introducer_furls = []
|
||||
self.introducer_clients = []
|
||||
@ -277,7 +277,7 @@ class FakeClient(_Client):
|
||||
# fake knowledge of another server
|
||||
self.storage_broker.test_add_server("other_nodeid",
|
||||
FakeDisplayableServer(
|
||||
serverid="other_nodeid", nickname=u"other_nickname \u263B", connected = True,
|
||||
serverid=b"other_nodeid", nickname=u"other_nickname \u263B", connected = True,
|
||||
last_connect_time = 10, last_loss_time = 20, last_rx_time = 30))
|
||||
self.storage_broker.test_add_server("disconnected_nodeid",
|
||||
FakeDisplayableServer(
|
||||
|
Loading…
Reference in New Issue
Block a user