python: make assoc_stream_id and stream_user_data in submit_syn_stream optional
This commit is contained in:
parent
595806a913
commit
dcba568ff9
|
@ -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:
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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()
|
||||
|
||||
|
|
Loading…
Reference in New Issue