Ticket #1985: amp_requiresanswer.diff

File amp_requiresanswer.diff, 1.1 KB (added by Richard Wall, 16 years ago)

A patch to the amp tests. I f I understand correctly, I don't think the NoAnswerHello command ever gets used because it's responder method is never called.

  • twisted/test/test_amp.py

     
    7878
    7979    fatalErrors = {DeathThreat: 'DEAD'}
    8080
    81 class NoAnswerHello(Hello):
    82     commandName = Hello.commandName
     81class NoAnswerHello(amp.Command):
     82    commandName = 'hello'
     83
     84    arguments = [('hello', amp.String()),
     85                 ('optional', amp.Boolean(optional=True)),
     86                 ('print', amp.Unicode(optional=True)),
     87                 ('from', TransportPeer(optional=True))]
     88    response = []
     89    errors = {UnfriendlyGreeting: 'UNFRIENDLY'}
     90    fatalErrors = {DeathThreat: 'DEAD'}
    8391    requiresAnswer = False
    8492
    8593class FutureHello(amp.Command):
     
    206214        return result
    207215    Hello.responder(cmdHello)
    208216
     217    def cmdNoAnswerHello(self, hello, From, optional=None, Print=None):
     218        self.greeted = True
     219    NoAnswerHello.responder(cmdNoAnswerHello)
     220
    209221    def cmdGetlist(self, length):
    210222        return {'body': [dict(x=1)] * length}
    211223    GetList.responder(cmdGetlist)