MCPcopy Index your code
hub / github.com/python-websockets/websockets / decode

Method decode

tests/legacy/test_framing.py:16–32  ·  view source on GitHub ↗
(self, message, mask=False, max_size=None, extensions=None)

Source from the content-addressed store, hash-verified

14
15class FramingTests(AsyncioTestCase):
16 def decode(self, message, mask=False, max_size=None, extensions=None):
17 stream = asyncio.StreamReader(loop=self.loop)
18 stream.feed_data(message)
19 stream.feed_eof()
20 with warnings.catch_warnings():
21 warnings.simplefilter("ignore")
22 frame = self.loop.run_until_complete(
23 Frame.read(
24 stream.readexactly,
25 mask=mask,
26 max_size=max_size,
27 extensions=extensions,
28 )
29 )
30 # Make sure all the data was consumed.
31 self.assertTrue(stream.at_eof())
32 return frame
33
34 def encode(self, frame, mask=False, extensions=None):
35 write = unittest.mock.Mock()

Calls 4

feed_dataMethod · 0.95
feed_eofMethod · 0.95
at_eofMethod · 0.95
readMethod · 0.80

Tested by

no test coverage detected