# Path: can4python/canframe_definition.py
# class CanFrameDefinition():
#     def __init__(self, frame_id, name='', dlc=constants.MAX_NUMBER_OF_CAN_DATA_BYTES, cycletime=None,
#                  frame_format=constants.CAN_FRAMEFORMAT_STANDARD):
#     def __repr__(self, long_text=True):
#     def frame_id(self):
#     def frame_id(self, value):
#     def dlc(self):
#     def dlc(self, value):
#     def cycletime(self):
#     def cycletime(self, value):
#     def throttle_time(self):
#     def throttle_time(self, value):
#     def frame_format(self):
#     def frame_format(self, value):
#     def producer_ids(self):
#     def producer_ids(self, value):
#     def get_descriptive_ascii_art(self):
#     def get_signal_mask(self):
#     def is_outbound(self, ego_node_ids):
# 
# Path: can4python/cansignal.py
# SYMBOL_LEAST_SIGNIFICANT_BIT = "L"
# SYMBOL_MOST_SIGNIFICANT_BIT = "M"
# SYMBOL_OTHER_VALID_BIT = "X"
#         MAX_COMMENT_LENGTH = 85
# class CanSignalDefinition():
#     def __init__(self, signalname, startbit, numberofbits, scalingfactor=1, valueoffset=0, defaultvalue=None,
#                  unit="", comment="", minvalue=None, maxvalue=None,
#                  endianness=constants.LITTLE_ENDIAN, signaltype=constants.CAN_SIGNALTYPE_UNSIGNED):
#     def endianness(self):
#     def endianness(self, value):
#     def signaltype(self):
#     def signaltype(self, value):
#     def scalingfactor(self):
#     def scalingfactor(self, value):
#     def valueoffset(self):
#     def valueoffset(self, value):
#     def startbit(self):
#     def startbit(self, value):
#     def defaultvalue(self):
#     def defaultvalue(self, value):
#     def minvalue(self):
#     def minvalue(self, value):
#     def maxvalue(self):
#     def maxvalue(self, value):
#     def numberofbits(self):
#     def numberofbits(self, value):
#     def __repr__(self):
#     def get_descriptive_ascii_art(self):
#     def get_maximum_possible_value(self):
#     def get_minimum_possible_value(self):
#     def get_minimum_dlc(self):
#     def _check_signal_value_range(self, attributename, value):
#     def _get_overview_string(self):
# 
# Path: can4python/configuration.py
# class Configuration():
#     def __init__(self, framedefinitions=None, busname=None, ego_node_ids=None):
#     def ego_node_ids(self):
#     def ego_node_ids(self, value):
#     def __repr__(self):
#     def get_descriptive_ascii_art(self):
#     def add_framedefinition(self, framedef):
#     def set_throttle_times(self, inputdict):
#     def set_throttle_times_from_signalnames(self, inputdict):
#     def set_receive_on_change_only(self, inputlist):
#     def set_receive_on_change_only_from_signalnames(self, inputlist):
#     def find_frameid_from_signalname(self, input_signalname):
# 
# Path: can4python/exceptions.py
# class CanException(Exception):
# class CanTimeoutException(CanException):
# class CanNotFoundByKernelException(CanException):


import copy
import os
import sys
import unittest
from can4python import canframe_definition
from can4python import cansignal
from can4python import configuration
from can4python import exceptions
        self.assertEqual(self.config.framedefinitions[FRAME_ID_SEND].throttle_time, None)
        self.config.set_throttle_times({FRAME_ID_SEND: 123})
        self.assertEqual(self.config.framedefinitions[FRAME_ID_SEND].throttle_time, 123)

    def testSetThrottleTimesWrongValues(self):
        self.assertRaises(exceptions.CanException, self.config.set_throttle_times, {NON_EXISTING_FRAME_ID: 123})
        self.assertRaises(exceptions.CanException, self.config.set_throttle_times, "ABC")
        self.assertRaises(exceptions.CanException, self.config.set_throttle_times, 123)

    def testSetThrottleTimesFromSignalnames(self):
        self.assertEqual(self.config.framedefinitions[FRAME_ID_SEND].throttle_time, None)
        self.config.set_throttle_times_from_signalnames({'testsignal1': 125})
        self.assertEqual(self.config.framedefinitions[FRAME_ID_SEND].throttle_time, 125)
        self.config.set_throttle_times_from_signalnames({'testsignal2': 126})
        self.assertEqual(self.config.framedefinitions[FRAME_ID_SEND].throttle_time, 126)

    def testSetThrottleTimesFromSignalnamesWrongValues(self):
        self.assertRaises(exceptions.CanException,
                          self.config.set_throttle_times_from_signalnames, {"nonexistingsignal": 123})
        self.assertRaises(exceptions.CanException, self.config.set_throttle_times_from_signalnames, "ABC")
        self.assertRaises(exceptions.CanException, self.config.set_throttle_times_from_signalnames, 123)

    def testSetReceiveOnChangeOnly(self):
        self.assertEqual(self.config.framedefinitions[FRAME_ID_SEND].receive_on_change_only, False)
        self.config.set_receive_on_change_only([FRAME_ID_SEND])
        self.assertEqual(self.config.framedefinitions[FRAME_ID_SEND].receive_on_change_only, True)

    def testSetReceiveOnChangeOnlyWrongValue(self):
        self.assertRaises(exceptions.CanException, self.config.set_receive_on_change_only, [NON_EXISTING_FRAME_ID])
        self.assertRaises(exceptions.CanException, self.config.set_receive_on_change_only, "ABC")

# Path: can4python/canframe_definition.py
# class CanFrameDefinition():
#     def __init__(self, frame_id, name='', dlc=constants.MAX_NUMBER_OF_CAN_DATA_BYTES, cycletime=None,
#                  frame_format=constants.CAN_FRAMEFORMAT_STANDARD):
#     def __repr__(self, long_text=True):
#     def frame_id(self):
#     def frame_id(self, value):
#     def dlc(self):
#     def dlc(self, value):
#     def cycletime(self):
#     def cycletime(self, value):
#     def throttle_time(self):
#     def throttle_time(self, value):
#     def frame_format(self):
#     def frame_format(self, value):
#     def producer_ids(self):
#     def producer_ids(self, value):
#     def get_descriptive_ascii_art(self):
#     def get_signal_mask(self):
#     def is_outbound(self, ego_node_ids):
# 
# Path: can4python/cansignal.py
# SYMBOL_LEAST_SIGNIFICANT_BIT = "L"
# SYMBOL_MOST_SIGNIFICANT_BIT = "M"
# SYMBOL_OTHER_VALID_BIT = "X"
#         MAX_COMMENT_LENGTH = 85
# class CanSignalDefinition():
#     def __init__(self, signalname, startbit, numberofbits, scalingfactor=1, valueoffset=0, defaultvalue=None,
#                  unit="", comment="", minvalue=None, maxvalue=None,
#                  endianness=constants.LITTLE_ENDIAN, signaltype=constants.CAN_SIGNALTYPE_UNSIGNED):
#     def endianness(self):
#     def endianness(self, value):
#     def signaltype(self):
#     def signaltype(self, value):
#     def scalingfactor(self):
#     def scalingfactor(self, value):
#     def valueoffset(self):
#     def valueoffset(self, value):
#     def startbit(self):
#     def startbit(self, value):
#     def defaultvalue(self):
#     def defaultvalue(self, value):
#     def minvalue(self):
#     def minvalue(self, value):
#     def maxvalue(self):
#     def maxvalue(self, value):
#     def numberofbits(self):
#     def numberofbits(self, value):
#     def __repr__(self):
#     def get_descriptive_ascii_art(self):
#     def get_maximum_possible_value(self):
#     def get_minimum_possible_value(self):
#     def get_minimum_dlc(self):
#     def _check_signal_value_range(self, attributename, value):
#     def _get_overview_string(self):
# 
# Path: can4python/configuration.py
# class Configuration():
#     def __init__(self, framedefinitions=None, busname=None, ego_node_ids=None):
#     def ego_node_ids(self):
#     def ego_node_ids(self, value):
#     def __repr__(self):
#     def get_descriptive_ascii_art(self):
#     def add_framedefinition(self, framedef):
#     def set_throttle_times(self, inputdict):
#     def set_throttle_times_from_signalnames(self, inputdict):
#     def set_receive_on_change_only(self, inputlist):
#     def set_receive_on_change_only_from_signalnames(self, inputlist):
#     def find_frameid_from_signalname(self, input_signalname):
# 
# Path: can4python/exceptions.py
# class CanException(Exception):
# class CanTimeoutException(CanException):
# class CanNotFoundByKernelException(CanException):


# Path: tests/test_configuration.py
import copy
import os
import sys
import unittest
from can4python import canframe_definition
from can4python import cansignal
from can4python import configuration
from can4python import exceptions

        self.assertEqual(self.config.framedefinitions[FRAME_ID_SEND].throttle_time, None)
        self.config.set_throttle_times({FRAME_ID_SEND: 123})
        self.assertEqual(self.config.framedefinitions[FRAME_ID_SEND].throttle_time, 123)

    def testSetThrottleTimesWrongValues(self):
        self.assertRaises(exceptions.CanException, self.config.set_throttle_times, {NON_EXISTING_FRAME_ID: 123})
        self.assertRaises(exceptions.CanException, self.config.set_throttle_times, "ABC")
        self.assertRaises(exceptions.CanException, self.config.set_throttle_times, 123)

    def testSetThrottleTimesFromSignalnames(self):
        self.assertEqual(self.config.framedefinitions[FRAME_ID_SEND].throttle_time, None)
        self.config.set_throttle_times_from_signalnames({'testsignal1': 125})
        self.assertEqual(self.config.framedefinitions[FRAME_ID_SEND].throttle_time, 125)
        self.config.set_throttle_times_from_signalnames({'testsignal2': 126})
        self.assertEqual(self.config.framedefinitions[FRAME_ID_SEND].throttle_time, 126)

    def testSetThrottleTimesFromSignalnamesWrongValues(self):
        self.assertRaises(exceptions.CanException,
                          self.config.set_throttle_times_from_signalnames, {"nonexistingsignal": 123})
        self.assertRaises(exceptions.CanException, self.config.set_throttle_times_from_signalnames, "ABC")
        self.assertRaises(exceptions.CanException, self.config.set_throttle_times_from_signalnames, 123)

    def testSetReceiveOnChangeOnly(self):
        self.assertEqual(self.config.framedefinitions[FRAME_ID_SEND].receive_on_change_only, False)
        self.config.set_receive_on_change_only([FRAME_ID_SEND])
        self.assertEqual(self.config.framedefinitions[FRAME_ID_SEND].receive_on_change_only, True)

    def testSetReceiveOnChangeOnlyWrongValue(self):
        self.assertRaises(exceptions.CanException, self.config.set_receive_on_change_only, [NON_EXISTING_FRAME_ID])
        self.assertRaises(exceptions.CanException, self.config.set_receive_on_change_only, "ABC")

        self.assertRaises(exceptions.CanException, self.config.set_receive_on_change_only, 123)