def when_both_sides_close_channel(self): # Client tries to close connection self.task = asyncio.async(self.channel.close(), loop=self.loop) self.tick() # Before OK arrives server closes connection self.server.send_method( self.channel.id, spec.ChannelClose(404, 'i am tired of you', 40, 50)) self.tick() self.task.result()
def when_error_arrives(self): self.server.send_method( self.channel.id, spec.ChannelClose(404, 'Bad queue', 40, 50))
def given_the_server_closed_the_channel(self): self.server.send_method(self.channel.id, spec.ChannelClose(123, 'i am tired of you', 40, 50)) self.server.reset()
def when_the_server_shuts_the_channel_down(self): self.server.send_method(self.channel.id, spec.ChannelClose(123, 'i am tired of you', 40, 50))
def it_should_send_ChannelClose(self): self.server.should_have_received_method(1, spec.ChannelClose(0, 'Channel closed by application', 0, 0))
def when_ChannelClose_arrives(self): self.server.send_method(self.channel.id, spec.ChannelClose(123, 'i am tired of you', 40, 50))
def when_ChannelClose_arrives(self): self.server.send_method(self.channel.id, spec.ChannelClose(406, "the precondition, she failed", 50, 10)) self.tick()