コード例 #1
0
 def tearDown(self):
     self.interface.close()
     try:
         self.simulated_can_process.terminate()
     except (AttributeError, ProcessLookupError) as _:
         pass
     enable_virtual_can_bus()
コード例 #2
0
    def setUp(self):
        enable_virtual_can_bus()
        self.canbus_raw = canbus.CanBus(copy.deepcopy(TESTCONFIG1), VIRTUAL_CAN_BUS_NAME, timeout=1.0)
        self.canbus_bcm = canbus.CanBus(copy.deepcopy(TESTCONFIG1), VIRTUAL_CAN_BUS_NAME, timeout=1.0, use_bcm=True)

        parent_directory = os.path.dirname(__file__)
        self.input_filename = os.path.join(parent_directory, INPUT_FILENAME)
        self.input_filename_no_busdefinition = os.path.join(parent_directory, INPUT_FILENAME_NO_BUSDEFINITION)

        self.simulated_can_process = None
コード例 #3
0
 def setUp(self):
     enable_virtual_can_bus()
     self.interface = caninterface_bcm.SocketCanBcmInterface(VIRTUAL_CAN_BUS_NAME, timeout=1.0)
     self.simulated_can_process = None