# Path: can4python/exceptions.py
# class CanException(Exception):
# class CanTimeoutException(CanException):
# class CanNotFoundByKernelException(CanException):
# 
# 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/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/canframe.py
# class CanFrame():
#     def __init__(self, frame_id, frame_data, frame_format=constants.CAN_FRAMEFORMAT_STANDARD):
#     def __repr__(self):
#     def __len__(self):
#     def from_empty_bytes(cls, frame_id, number_of_bytes, frame_format=constants.CAN_FRAMEFORMAT_STANDARD):
#     def from_rawframe(cls, rawframe):
#     def frame_id(self):
#     def frame_id(self, value):
#     def frame_data(self):
#     def frame_data(self, value):
#     def frame_format(self):
#     def frame_format(self, value):
#     def get_signalvalue(self, signaldefinition):
#     def set_signalvalue(self, signaldefinition, physical_value=None):
#     def unpack(self, frame_definitions):
#     def get_rawframe(self):
#     def get_descriptive_ascii_art(self):


import sys
import unittest
from can4python import exceptions
from can4python import cansignal
from can4python import canframe_definition
from can4python import canframe
        self.assertRaises(exceptions.CanException, setattr, self.frame, 'frame_id', "1,0")
        self.assertRaises(exceptions.CanException, setattr, self.frame, 'frame_id', None)

    def testFrameFormatGet(self):
        self.assertEqual(self.frame.frame_format, 'standard')

    def testFrameFormatSet(self):
        known_values = ['standard', 'extended']
        for value in known_values:
            self.frame.frame_format = value
            self.assertEqual(self.frame.frame_format, value)

    def testFrameFormatSetWrongValue(self):
        self.assertRaises(exceptions.CanException, setattr, self.frame, 'frame_format', 7)
        self.assertRaises(exceptions.CanException, setattr, self.frame, 'frame_format', 'ABC')

    def testFramedataGet(self):
        self.assertEqual(self.frame.frame_data, b'\x00\x02\x00\x08\x00\x00\x00\xff')

    def testFramedataSet(self):
        known_values = [b'', b'\x00', b'\x01\x02\x03\x04\x05\x06\x07\x08']
        for value in known_values:
            self.frame.frame_data = value
            self.assertEqual(self.frame.frame_data, value)

    def testFramedataSetWrongValue(self):
        self.assertRaises(exceptions.CanException, setattr, self.frame, 'frame_data',
                          b'\x01\x02\x03\x04\x05\x06\x07\x08\x09')
        self.assertRaises(exceptions.CanException, setattr, self.frame, 'frame_data', None)
        self.assertRaises(exceptions.CanException, setattr, self.frame, 'frame_data', "7")

# Path: can4python/exceptions.py
# class CanException(Exception):
# class CanTimeoutException(CanException):
# class CanNotFoundByKernelException(CanException):
# 
# 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/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/canframe.py
# class CanFrame():
#     def __init__(self, frame_id, frame_data, frame_format=constants.CAN_FRAMEFORMAT_STANDARD):
#     def __repr__(self):
#     def __len__(self):
#     def from_empty_bytes(cls, frame_id, number_of_bytes, frame_format=constants.CAN_FRAMEFORMAT_STANDARD):
#     def from_rawframe(cls, rawframe):
#     def frame_id(self):
#     def frame_id(self, value):
#     def frame_data(self):
#     def frame_data(self, value):
#     def frame_format(self):
#     def frame_format(self, value):
#     def get_signalvalue(self, signaldefinition):
#     def set_signalvalue(self, signaldefinition, physical_value=None):
#     def unpack(self, frame_definitions):
#     def get_rawframe(self):
#     def get_descriptive_ascii_art(self):


# Path: tests/test_canframe.py
import sys
import unittest
from can4python import exceptions
from can4python import cansignal
from can4python import canframe_definition
from can4python import canframe

        self.assertRaises(exceptions.CanException, setattr, self.frame, 'frame_id', "1,0")
        self.assertRaises(exceptions.CanException, setattr, self.frame, 'frame_id', None)

    def testFrameFormatGet(self):
        self.assertEqual(self.frame.frame_format, 'standard')

    def testFrameFormatSet(self):
        known_values = ['standard', 'extended']
        for value in known_values:
            self.frame.frame_format = value
            self.assertEqual(self.frame.frame_format, value)

    def testFrameFormatSetWrongValue(self):
        self.assertRaises(exceptions.CanException, setattr, self.frame, 'frame_format', 7)
        self.assertRaises(exceptions.CanException, setattr, self.frame, 'frame_format', 'ABC')

    def testFramedataGet(self):
        self.assertEqual(self.frame.frame_data, b'\x00\x02\x00\x08\x00\x00\x00\xff')

    def testFramedataSet(self):
        known_values = [b'', b'\x00', b'\x01\x02\x03\x04\x05\x06\x07\x08']
        for value in known_values:
            self.frame.frame_data = value
            self.assertEqual(self.frame.frame_data, value)

    def testFramedataSetWrongValue(self):
        self.assertRaises(exceptions.CanException, setattr, self.frame, 'frame_data',
                          b'\x01\x02\x03\x04\x05\x06\x07\x08\x09')
        self.assertRaises(exceptions.CanException, setattr, self.frame, 'frame_data', None)
        self.assertRaises(exceptions.CanException, setattr, self.frame, 'frame_data', "7")

        self.assertRaises(exceptions.CanException, setattr, self.frame, 'frame_data', "\x01")