def connect(self): if self.error_auth: self.connected = False protocol_entity = failure_protocol_entity() else: self.connected = True protocol_entity = success_protocol_entity() self.toUpper(protocol_entity) if not self.connected: raise AuthError()
def test_connection_failure(self): self.connected = True self.on_failure(failure_protocol_entity()) self.assertFalse(self.connected)