Show
Ignore:
Timestamp:
07/09/08 15:07:58 (6 months ago)
Author:
nick
Message:

Merged source:pyamf/branches/twisted-gateway-tuple-313

Fixes: #313
Author: nick
Reviewer: thijs

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • pyamf/trunk/pyamf/tests/gateway/test_twisted.py

    r1416 r1500  
    274274        return d.addBoth(switch) 
    275275 
     276    def test_tuple(self): 
     277        def echo(data): 
     278            return data 
     279 
     280        self.gw.addService(echo) 
     281 
     282        env = remoting.Envelope(pyamf.AMF0, pyamf.ClientTypes.Flash9) 
     283        request = remoting.Request('echo', body=[('Hi', 'Mom')]) 
     284        env['/1'] = request 
     285 
     286        d = client.getPage("http://127.0.0.1:%d/" % (self.port,), 
     287                method="POST", postdata=remoting.encode(env).getvalue()) 
     288 
     289        def cb(result): 
     290            response = remoting.decode(result) 
     291            body_response = response['/1'] 
     292 
     293            self.assertEquals(body_response.status, remoting.STATUS_OK) 
     294            self.assertEquals(body_response.body, ['Hi', 'Mom']) 
     295 
     296        return d.addCallback(cb) 
     297 
    276298class DummyHTTPRequest: 
    277299    def __init__(self):