mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2024-12-24 07:06:41 +00:00
Ensure the fake matches the real Wormhole interface.
This commit is contained in:
parent
4257f22d77
commit
4005d90024
@ -16,6 +16,8 @@ class _FakeWormhole(object):
|
||||
|
||||
def __init__(self, outgoing_messages):
|
||||
self.messages = []
|
||||
for o in outgoing_messages:
|
||||
assert isinstance(o, bytes)
|
||||
self._outgoing = outgoing_messages
|
||||
|
||||
def get_code(self):
|
||||
@ -26,15 +28,16 @@ class _FakeWormhole(object):
|
||||
|
||||
def get_welcome(self):
|
||||
return defer.succeed(
|
||||
json.dumps({
|
||||
{
|
||||
u"welcome": {},
|
||||
})
|
||||
}
|
||||
)
|
||||
|
||||
def allocate_code(self):
|
||||
return None
|
||||
|
||||
def send_message(self, msg):
|
||||
assert isinstance(msg, bytes)
|
||||
self.messages.append(msg)
|
||||
|
||||
def get_message(self):
|
||||
|
Loading…
Reference in New Issue
Block a user