MCPcopy Index your code
hub / github.com/python/cpython / testLoopback

Method testLoopback

Lib/test/test_socket.py:2317–2323  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

2315 @unittest.skipUnless(hasattr(socket, "CAN_RAW_LOOPBACK"),
2316 'socket.CAN_RAW_LOOPBACK required for this test.')
2317 def testLoopback(self):
2318 with socket.socket(socket.PF_CAN, socket.SOCK_RAW, socket.CAN_RAW) as s:
2319 for loopback in (0, 1):
2320 s.setsockopt(socket.SOL_CAN_RAW, socket.CAN_RAW_LOOPBACK,
2321 loopback)
2322 self.assertEqual(loopback,
2323 s.getsockopt(socket.SOL_CAN_RAW, socket.CAN_RAW_LOOPBACK))
2324
2325 @unittest.skipUnless(hasattr(socket, "CAN_RAW_FILTER"),
2326 'socket.CAN_RAW_FILTER required for this test.')

Callers

nothing calls this directly

Calls 4

socketMethod · 0.80
setsockoptMethod · 0.45
assertEqualMethod · 0.45
getsockoptMethod · 0.45

Tested by

no test coverage detected