Skip to content

Commit d3cf9b8

Browse files
[COVERAGE] Improved doctest-coverage slightly (- WIP #441 -)
Changes in file multicast/hear.py: * added doctest testcase for handler with STOP message
1 parent 975ca15 commit d3cf9b8

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

multicast/hear.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -701,6 +701,20 @@ def handle(self):
701701
>>>
702702
>>> multicast.endSocket(tst_fixture_sock)
703703
>>>
704+
705+
Testcase 4: `handle` raises on valid STOP requests.
706+
707+
>>> tst_fixture_sock = multicast.genSocket()
708+
>>> handler.request = ("The Test is STOP", tst_fixture_sock)
709+
>>> handler.client_address = ("224.0.1.3", 54321)
710+
>>> try:
711+
... handler.handle()
712+
... except multicast.exceptions.ShutdownCommandReceived:
713+
... print('ShutdownCommandReceived raised')
714+
ShutdownCommandReceived raised
715+
>>>
716+
>>> multicast.endSocket(tst_fixture_sock)
717+
>>>
704718
"""
705719
(data, sock) = self.request
706720
if data is None or not sock:

0 commit comments

Comments
 (0)