Skip to content

Commit 96d3adf

Browse files
committed
Add tests for previous commit.
1 parent 61b69db commit 96d3adf

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

tests/legacy/test_protocol.py

+14
Original file line numberDiff line numberDiff line change
@@ -1472,10 +1472,24 @@ def test_broadcast_text(self):
14721472
broadcast([self.protocol], "café")
14731473
self.assertOneFrameSent(True, OP_TEXT, "café".encode())
14741474

1475+
@unittest.skipIf(
1476+
sys.version_info[:2] < (3, 11), "raise_exceptions requires Python 3.11+"
1477+
)
1478+
def test_broadcast_text_reports_no_errors(self):
1479+
broadcast([self.protocol], "café", raise_exceptions=True)
1480+
self.assertOneFrameSent(True, OP_TEXT, "café".encode())
1481+
14751482
def test_broadcast_binary(self):
14761483
broadcast([self.protocol], b"tea")
14771484
self.assertOneFrameSent(True, OP_BINARY, b"tea")
14781485

1486+
@unittest.skipIf(
1487+
sys.version_info[:2] < (3, 11), "raise_exceptions requires Python 3.11+"
1488+
)
1489+
def test_broadcast_binary_reports_no_errors(self):
1490+
broadcast([self.protocol], b"tea", raise_exceptions=True)
1491+
self.assertOneFrameSent(True, OP_BINARY, b"tea")
1492+
14791493
def test_broadcast_type_error(self):
14801494
with self.assertRaises(TypeError):
14811495
broadcast([self.protocol], ["ca", "fé"])

0 commit comments

Comments
 (0)