Skip to content

Commit 84a762b

Browse files
committed
Add test cases for Unix sockets
1 parent b3c011f commit 84a762b

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

tests.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,18 @@ def func():
345345
self.assertRaises(raises[i], func)
346346

347347

348+
class UnixSocketInternalTests(InternalTests):
349+
"""
350+
These tests run the same internal communication tests, but over a
351+
Unix socket instead of a TCP socket.
352+
"""
353+
def setUp(self):
354+
self.port = "/tmp/jsonrpc%d.sock" % (PORTS.pop())
355+
self.server = server_set_up(addr=self.port, address_family=socket.AF_UNIX)
356+
357+
def get_client(self):
358+
return Server('unix:%s' % self.port)
359+
348360
""" Test Methods """
349361
def subtract(minuend, subtrahend):
350362
""" Using the keywords from the JSON-RPC v2 doc """

0 commit comments

Comments
 (0)