##// END OF EJS Templates
wireprotoframing: record when new stream is encountered...
Gregory Szorc -
r37674:e6870bca default
parent child Browse files
Show More
@@ -1029,6 +1029,8 b' class clientreactor(object):'
1029 1029 'without beginning of stream flag set'),
1030 1030 }
1031 1031
1032 self._incomingstreams[frame.streamid] = stream(frame.streamid)
1033
1032 1034 if frame.streamflags & STREAM_FLAG_ENCODING_APPLIED:
1033 1035 raise error.ProgrammingError('support for decoding stream '
1034 1036 'payloads not yet implemneted')
@@ -105,6 +105,26 b' class BadFrameRecvTests(unittest.TestCas'
105 105 'unhandled frame type'):
106 106 sendframe(reactor, ffs(b'1 0 stream-begin text-output 0 foo'))
107 107
108 class StreamTests(unittest.TestCase):
109 def testmultipleresponseframes(self):
110 reactor = framing.clientreactor(buffersends=False)
111
112 request, action, meta = reactor.callcommand(b'foo', {})
113
114 self.assertEqual(action, 'sendframes')
115 for f in meta['framegen']:
116 pass
117
118 action, meta = sendframe(
119 reactor,
120 ffs(b'%d 0 stream-begin 4 0 foo' % request.requestid))
121 self.assertEqual(action, 'responsedata')
122
123 action, meta = sendframe(
124 reactor,
125 ffs(b'%d 0 0 4 eos bar' % request.requestid))
126 self.assertEqual(action, 'responsedata')
127
108 128 if __name__ == '__main__':
109 129 import silenttestrunner
110 130 silenttestrunner.main(__name__)
General Comments 0
You need to be logged in to leave comments. Login now