From 941e4fe18a5e1ea6396cab0971b4daf6b544b44a Mon Sep 17 00:00:00 2001 From: meejah Date: Wed, 7 Apr 2021 16:44:17 -0600 Subject: [PATCH] clean up imports --- .../test/test_transit_server.py | 33 ++++++------------- src/wormhole_transit_relay/transit_server.py | 1 - 2 files changed, 10 insertions(+), 24 deletions(-) diff --git a/src/wormhole_transit_relay/test/test_transit_server.py b/src/wormhole_transit_relay/test/test_transit_server.py index d94577b..e281d3d 100644 --- a/src/wormhole_transit_relay/test/test_transit_server.py +++ b/src/wormhole_transit_relay/test/test_transit_server.py @@ -1,10 +1,16 @@ from __future__ import print_function, unicode_literals -import base64 from binascii import hexlify from twisted.trial import unittest -from twisted.test import proto_helpers -from twisted.internet.defer import inlineCallbacks -from twisted.internet.task import deferLater +from twisted.test import iosim +from autobahn.twisted.websocket import ( + WebSocketServerFactory, + WebSocketClientFactory, + WebSocketClientProtocol, +) +from autobahn.twisted.testing import ( + create_pumper, + MemoryReactorClockResolver, +) from .common import ServerBase from ..server_state import ( MemoryUsageRecorder, @@ -14,15 +20,6 @@ from ..transit_server import ( WebSocketTransitConnection, ) -from ..transit_server import Transit, TransitConnection, WebSocketTransitConnection -from twisted.internet.protocol import ( - ServerFactory, - ClientFactory, -) -from twisted.internet import protocol -from ..server_state import create_usage_tracker -from autobahn.twisted.websocket import WebSocketServerFactory - def handshake(token, side=None): hs = b"please relay " + hexlify(token) @@ -478,16 +475,6 @@ class Usage(ServerBase, unittest.TestCase): self.assertEqual(self._usage.events[2]["mood"], "happy") -from twisted.test import iosim -from twisted.internet.testing import MemoryReactorClock -from twisted.internet.address import IPv4Address -from autobahn.twisted.testing import ( - create_pumper, - create_memory_agent, - MemoryReactorClockResolver, -) - - class UsageWebSockets(Usage): """ All the tests of 'Usage' except with a WebSocket (instead of TCP) diff --git a/src/wormhole_transit_relay/transit_server.py b/src/wormhole_transit_relay/transit_server.py index 7f9a1ca..bc16b86 100644 --- a/src/wormhole_transit_relay/transit_server.py +++ b/src/wormhole_transit_relay/transit_server.py @@ -2,7 +2,6 @@ from __future__ import print_function, unicode_literals import re import time from twisted.python import log -from twisted.internet import protocol from twisted.protocols.basic import LineReceiver from autobahn.twisted.websocket import WebSocketServerProtocol