(self)
| 2256 | @unittest.skipUnless(hasattr(socket, "CAN_RAW_FILTER"), |
| 2257 | 'socket.CAN_RAW_FILTER required for this test.') |
| 2258 | def testFilter(self): |
| 2259 | can_id, can_mask = 0x200, 0x700 |
| 2260 | can_filter = struct.pack("=II", can_id, can_mask) |
| 2261 | with socket.socket(socket.PF_CAN, socket.SOCK_RAW, socket.CAN_RAW) as s: |
| 2262 | s.setsockopt(socket.SOL_CAN_RAW, socket.CAN_RAW_FILTER, can_filter) |
| 2263 | self.assertEqual(can_filter, |
| 2264 | s.getsockopt(socket.SOL_CAN_RAW, socket.CAN_RAW_FILTER, 8)) |
| 2265 | s.setsockopt(socket.SOL_CAN_RAW, socket.CAN_RAW_FILTER, bytearray(can_filter)) |
| 2266 | |
| 2267 | |
| 2268 | @unittest.skipUnless(HAVE_SOCKET_CAN, 'SocketCan required for this test.') |
nothing calls this directly
no test coverage detected