class HandshakeObserver(object): """ Provides a link from the negotiator to the test case. @ivar success: Whether the observers L{handshakeSuccess} has been called. If C{True} then the attribute C{data} will be set. @ivar buffer: File like object containing any data written by the handshake negotiator. @ivar remaining_data: When L{success} is C{True}, this will contain any left over data from the handshake negotiator. """ implements(handshake.IHandshakeObserver) def __init__(self): self.buffer = BufferedByteStream() self.success = False self.data = None def write(self, data): self.buffer.write(data) def handshakeSuccess(self, data): self.success = True self.data = data
class HandshakeObserver(object): """ Provides a link from the negotiator to the test case. """ failure = None def __init__(self, test): self.buffer = BufferedByteStream() self.test = test self.test.succeeded = False def write(self, data): self.buffer.write(data) def handshakeSuccess(self, data): self.test.succeeded = True
def __init__(self, test): self.buffer = BufferedByteStream() self.test = test self.test.succeeded = False
def __init__(self): self.buffer = BufferedByteStream() self.success = False self.data = None