def when_client_closes_connection(self): task = asyncio.async(self.connection.close()) self.tick() self.server.send_method(0, spec.ConnectionCloseOK()) self.tick() self.tick() task.result()
def when_connection_is_closed(self): self.task = asyncio.async(self.connection.close(), loop=self.loop) self.server.send_method(0, spec.ConnectionCloseOK()) self.tick() self.was_closed = self.channel.is_closed() self.loop.run_until_complete(asyncio.wait_for(self.task, 0.2))
def when_connection_close_ok_arrives(self): self.server.send_method(0, spec.ConnectionCloseOK())
def it_should_send_close_ok(self): self.server.should_have_received_method(0, spec.ConnectionCloseOK())