MCPcopy Create free account
hub / github.com/EasyIME/PIME / test_mask

Method test_mask

python/python3/tornado/test/websocket_test.py:738–753  ·  view source on GitHub ↗
(self: typing.Any)

Source from the content-addressed store, hash-verified

736 raise NotImplementedError()
737
738 def test_mask(self: typing.Any):
739 self.assertEqual(self.mask(b"abcd", b""), b"")
740 self.assertEqual(self.mask(b"abcd", b"b"), b"\x03")
741 self.assertEqual(self.mask(b"abcd", b"54321"), b"TVPVP")
742 self.assertEqual(self.mask(b"ZXCV", b"98765432"), b"c`t`olpd")
743 # Include test cases with \x00 bytes (to ensure that the C
744 # extension isn't depending on null-terminated strings) and
745 # bytes with the high bit set (to smoke out signedness issues).
746 self.assertEqual(
747 self.mask(b"\x00\x01\x02\x03", b"\xff\xfb\xfd\xfc\xfe\xfa"),
748 b"\xff\xfa\xff\xff\xfe\xfb",
749 )
750 self.assertEqual(
751 self.mask(b"\xff\xfb\xfd\xfc", b"\x00\x01\x02\x03\x04\x05"),
752 b"\xff\xfa\xff\xff\xfb\xfe",
753 )
754
755
756class PythonMaskFunctionTest(MaskFunctionMixin, unittest.TestCase):

Callers

nothing calls this directly

Calls 1

maskMethod · 0.95

Tested by

no test coverage detected