python: make assoc_stream_id and stream_user_data in submit_syn_stream optional

This commit is contained in:
Tatsuhiro Tsujikawa 2012-08-24 23:34:48 +09:00
parent 595806a913
commit dcba568ff9
3 changed files with 13 additions and 13 deletions

View File

@ -408,7 +408,7 @@ Session Objects
The :py:class:`InvalidArgumentError` will be raised if the *nv*
includes empty name or ``None`` value.
.. py:method:: Session.submit_syn_stream(flags, assoc_stream_id, pri, nv, stream_user_data)
.. py:method:: Session.submit_syn_stream(flags, pri, nv, assoc_stream_id=0, stream_user_data=None)
Submits SYN_STREAM frame. The *flags* is bitwise OR of the
following values:

View File

@ -855,8 +855,8 @@ cdef class Session:
elif rv == cspdylay.SPDYLAY_ERR_NOMEM:
raise MemoryError()
cpdef submit_syn_stream(self, flags, assoc_stream_id, pri, nv,
stream_user_data):
cpdef submit_syn_stream(self, flags, pri, nv, assoc_stream_id=0,
stream_user_data=None):
cdef int rv
cdef char **cnv
nv = pynv_encode(nv)

View File

@ -123,8 +123,8 @@ class SpdylayTests(unittest.TestCase):
self.client_streams.recv_data.getvalue())
def test_submit_syn_stream_and_syn_stream(self):
self.client_session.submit_syn_stream(spdylay.CTRL_FLAG_FIN, 0, 2,
[(u':path', u'/')], None)
self.client_session.submit_syn_stream(spdylay.CTRL_FLAG_FIN, 2,
[(u':path', u'/')])
self.client_session.send()
self.server_session.recv()
@ -148,8 +148,8 @@ class SpdylayTests(unittest.TestCase):
self.assertEqual((u':version', u'HTTP/1.1'), frame.nv[0])
def test_submit_rst_stream(self):
self.client_session.submit_syn_stream(spdylay.CTRL_FLAG_FIN, 0, 2,
[(u':path', u'/')], None)
self.client_session.submit_syn_stream(spdylay.CTRL_FLAG_FIN, 2,
[(u':path', u'/')])
self.client_session.send()
self.server_session.recv()
@ -267,8 +267,8 @@ class SpdylayTests(unittest.TestCase):
self.client_session.send()
def test_submit_data(self):
self.client_session.submit_syn_stream(spdylay.CTRL_FLAG_NONE, 0, 2,
[(u':path', u'/')], None)
self.client_session.submit_syn_stream(spdylay.CTRL_FLAG_NONE, 2,
[(u':path', u'/')])
self.client_session.send()
self.server_session.recv()
@ -286,8 +286,8 @@ class SpdylayTests(unittest.TestCase):
self.server_streams.recv_data.getvalue())
def test_submit_headers(self):
self.client_session.submit_syn_stream(spdylay.CTRL_FLAG_NONE, 0, 2,
[(u':path', u'/')], None)
self.client_session.submit_syn_stream(spdylay.CTRL_FLAG_NONE, 2,
[(u':path', u'/')])
self.client_session.send()
self.server_session.recv()
@ -318,8 +318,8 @@ class SpdylayTests(unittest.TestCase):
self.assertEqual(1, frame.unique_id)
def test_submit_window_update(self):
self.client_session.submit_syn_stream(spdylay.CTRL_FLAG_NONE, 0, 2,
[(u':path', u'/')], None)
self.client_session.submit_syn_stream(spdylay.CTRL_FLAG_NONE, 2,
[(u':path', u'/')])
self.client_session.send()
self.server_session.recv()