diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/test_utils.py | 11 | ||||
-rw-r--r-- | test/test_websockets.py | 4 |
2 files changed, 14 insertions, 1 deletions
diff --git a/test/test_utils.py b/test/test_utils.py index 971e5076..0cdd3fae 100644 --- a/test/test_utils.py +++ b/test/test_utils.py @@ -1,5 +1,14 @@ from netlib import utils -import socket +import tutils + + +def test_bidi(): + b = utils.BiDi(a=1, b=2) + assert b.a == 1 + assert b[1] == "a" + tutils.raises(AttributeError, getattr, b, "c") + tutils.raises(KeyError, b.__getitem__, 5) + def test_hexdump(): assert utils.hexdump("one\0"*10) diff --git a/test/test_websockets.py b/test/test_websockets.py index 4b286b6f..9266d93e 100644 --- a/test/test_websockets.py +++ b/test/test_websockets.py @@ -184,6 +184,10 @@ class TestFrameHeader: round(opcode=websockets.OPCODE.PING) round(masking_key="test") + def test_human_readable(self): + f = websockets.FrameHeader(masking_key="test", mask=False) + assert f.human_readable() + def test_funky(self): f = websockets.FrameHeader(masking_key="test", mask=False) bytes = f.to_bytes() |