amp responder changes int to string

[email protected] Tue, 27 Oct 2009 22:16:42 -0000
Newsgroups gmane.comp.python.twisted.bugs
Message-ID <[email protected]>
New submission from hagna <[email protected]>:

Steps to duplicate

{{{
from twisted.trial.unittest import TestCase
from twisted.internet.defer import Deferred
from twisted.protocols import amp

class BugCMD(amp.Command):
    arguments = [('identifier', amp.String())]

    response = [('error', amp.Integer())]



class NetworkController(amp.AMP):
    def startBug2(self, identifier):
        return {'error':0}
    BugCMD.responder(startBug2)



class ControllerTests(TestCase):

    def setUp(self):
        self.controller = NetworkController()
        self.identifier = 123


    def test_BugCMD(self):

        responder = self.controller.lookupFunction(BugCMD.commandName)
        d = responder({
                'identifier': self.identifier,
                })

        def gotBugCMD(box):
            self.assertEqual(box, amp.AmpBox({'error':0}))
        d.addCallback(gotBugCMD)
        return d
}}}


----------
Type     : defect
Component: core
Keywords : 
Priority : normal
Nosy     : 
----------
http://twistedmatrix.com/trac/ticket/4064