diff --git a/src/wormhole_transit_relay/test/common.py b/src/wormhole_transit_relay/test/common.py index a0b0c28..ed2e976 100644 --- a/src/wormhole_transit_relay/test/common.py +++ b/src/wormhole_transit_relay/test/common.py @@ -81,6 +81,8 @@ class ServerBase: _received = b"" connected = False + # override Protocol callbacks + def connectionMade(self): self.connected = True return Protocol.connectionMade(self) @@ -89,15 +91,17 @@ class ServerBase: self.connected = False return Protocol.connectionLost(self, reason) + def dataReceived(self, data): + self._received = self._received + data + + # ITransitClient API + def send(self, data): self.transport.write(data) def disconnect(self): self.transport.loseConnection() - def dataReceived(self, data): - self._received = self._received + data - def reset_received_data(self): self._received = b""