(self)
| 2325 | @unittest.skipUnless(hasattr(socket, "CAN_RAW_FILTER"), |
| 2326 | 'socket.CAN_RAW_FILTER required for this test.') |
| 2327 | def testFilter(self): |
| 2328 | can_id, can_mask = 0x200, 0x700 |
| 2329 | can_filter = struct.pack("=II", can_id, can_mask) |
| 2330 | with socket.socket(socket.PF_CAN, socket.SOCK_RAW, socket.CAN_RAW) as s: |
| 2331 | s.setsockopt(socket.SOL_CAN_RAW, socket.CAN_RAW_FILTER, can_filter) |
| 2332 | self.assertEqual(can_filter, |
| 2333 | s.getsockopt(socket.SOL_CAN_RAW, socket.CAN_RAW_FILTER, 8)) |
| 2334 | s.setsockopt(socket.SOL_CAN_RAW, socket.CAN_RAW_FILTER, bytearray(can_filter)) |
| 2335 | |
| 2336 | |
| 2337 | @unittest.skipUnless(HAVE_SOCKET_CAN, 'SocketCan required for this test.') |
nothing calls this directly
no test coverage detected