Skip to content

Commit 7efe793

Browse files
committed
fix/change test at framing.Frame
1 parent 77539f5 commit 7efe793

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

ws4py/framing.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,16 @@ def __init__(self, opcode=None, body='', masking_key=None, fin=0, rsv1=0, rsv2=0
2222
2323
.. code-block:: python
2424
:linenos:
25-
26-
>>> f = Frame(OPCODE_TEXT, 'hello world', os.urandom(4), fin=1)
25+
>>> test_mask = '\xbe\x04\xe6j' # perhaps from os.urandom(4)
26+
>>> f = Frame(OPCODE_TEXT, 'hello world', masking_key=test_mask, fin=1)
2727
>>> bytes = f.build()
28+
>>> bytes.encode('hex')
29+
'818bbe04e66ad6618a06d1249105cc6882'
2830
>>> f = Frame()
31+
>>> f.parser.send(bytes[0])
32+
1
2933
>>> f.parser.send(bytes[1])
30-
>>> f.parser.send(bytes[2])
31-
>>> f.parser.send(bytes[2:])
34+
4
3235
3336
.. seealso:: Data Framing http://tools.ietf.org/html/rfc6455#section-5.2
3437
"""

0 commit comments

Comments
 (0)