Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove twisted defer return value #54

Merged
merged 2 commits into from
Dec 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/wormhole_mailbox_server/test/test_web.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import treq
from twisted.trial import unittest
from twisted.internet import defer, reactor
from twisted.internet.defer import inlineCallbacks, returnValue
from twisted.internet.defer import inlineCallbacks
from ..web import make_web_server
from ..server import SidedMessage
from ..database import create_or_upgrade_usage_db
Expand Down Expand Up @@ -38,7 +38,7 @@ def make_client(self):
reactor.connectTCP("127.0.0.1", self.rdv_ws_port, f)
c = yield f.d
self._clients.append(c)
returnValue(c)
return c

@inlineCallbacks
def test_log_http(self):
Expand Down Expand Up @@ -108,7 +108,7 @@ def make_client(self):
reactor.connectTCP("127.0.0.1", self.rdv_ws_port, f)
c = yield f.d
self._clients.append(c)
returnValue(c)
return c

def check_welcome(self, data):
self.failUnlessIn("welcome", data)
Expand Down
6 changes: 3 additions & 3 deletions src/wormhole_mailbox_server/test/ws_client.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from __future__ import print_function, unicode_literals
import json, itertools
from twisted.internet import defer
from twisted.internet.defer import inlineCallbacks, returnValue
from twisted.internet.defer import inlineCallbacks
from autobahn.twisted import websocket

class WSClient(websocket.WebSocketClientProtocol):
Expand Down Expand Up @@ -49,7 +49,7 @@ def next_non_ack(self):
print("unexpected onClose", m)
raise AssertionError("unexpected onClose")
if m["type"] != "ack":
returnValue(m)
return m

def strip_acks(self):
self.events = [e for e in self.events if e["type"] != "ack"]
Expand All @@ -73,7 +73,7 @@ def sync(self):
ev = yield self.next_event()
if ev["type"] == "pong" and ev["pong"] == ping:
self.events = old_events + self.events
returnValue(None)
return None
old_events.append(ev)

class WSFactory(websocket.WebSocketClientFactory):
Expand Down
Loading