def test_04_InsteonLight(self): l_light = self.m_core_api.read_core_lighting_xml( self.m_device, self.m_xml.light, self.m_version) insteonXml.ReadXml(l_light, self.m_xml.light) self.assertEqual(l_light.Name, TESTING_LIGHT_NAME_0) self.assertEqual(l_light.DeviceFamily, TESTING_DEVICE_FAMILY_INSTEON) self.assertEqual(l_light.InsteonAddress, conversions.dotted_hex2int(TESTING_INSTEON_ADDRESS_0))
def test_03_Insteon(self): """Read the Insteon specific information. """ l_insteon = insteonXml._read_insteon(self.m_xml.light) self.assertEqual(conversions.int2dotted_hex(l_insteon.InsteonAddress, 3), TESTING_INSTEON_ADDRESS_0) self.assertEqual(conversions.int2dotted_hex(l_insteon.DevCat, 2), TESTING_INSTEON_DEVCAT_0) self.assertEqual(l_insteon.GroupList, TESTING_INSTEON_GROUP_LIST_0) self.assertEqual(l_insteon.GroupNumber, int(TESTING_INSTEON_GROUP_NUM_0)) self.assertEqual(conversions.int2dotted_hex(l_insteon.ProductKey, 3), TESTING_INSTEON_PRODUCT_KEY_0)
def test_03_Insteon(self): """Read the Insteon specific information. """ l_obj = insteonXml._read_insteon(self.m_xml.light) # print(PrettyFormatAny.form(l_obj, 'C1-03-A - Insteon (only)')) self.assertEqual(conversions.int2dotted_hex(l_obj.DevCat, 2), TESTING_INSTEON_DEVCAT_0) self.assertEqual(str(l_obj.EngineVersion), TESTING_INSTEON_ENGINE_VERSION_0) self.assertEqual(str(l_obj.FirmwareVersion), TESTING_INSTEON_FIRMWARE_VERSION_0) self.assertEqual(l_obj.GroupList, TESTING_INSTEON_GROUP_LIST_0) self.assertEqual(str(l_obj.GroupNumber), TESTING_INSTEON_GROUP_NUM_0) self.assertEqual(conversions.int2dotted_hex(l_obj.InsteonAddress, 3), TESTING_INSTEON_ADDRESS_0) self.assertEqual(conversions.int2dotted_hex(l_obj.ProductKey, 3), TESTING_INSTEON_PRODUCT_KEY_0)
def test_03_UpbLight(self): l_xml = self.m_api.write_base_device_object_xml('Light', self.m_light) insteonXml.WriteXml(l_xml, self.m_light) print(PrettyFormatAny.form(l_xml, 'C2_03-A - Lights XML')) self.assertEqual(l_xml.attrib['Name'], TESTING_LIGHT_NAME_0) self.assertEqual(l_xml.attrib['Key'], TESTING_LIGHT_KEY_0) self.assertEqual(l_xml.attrib['Active'], TESTING_LIGHT_ACTIVE_0) self.assertEqual(l_xml.find('DevCat').text, TESTING_INSTEON_DEVCAT_0) self.assertEqual(l_xml.find('EngineVersion').text, TESTING_INSTEON_ENGINE_VERSION_0) self.assertEqual(l_xml.find('FirmwareVersion').text, TESTING_INSTEON_FIRMWARE_VERSION_0) self.assertEqual(l_xml.find('GroupList').text, TESTING_INSTEON_GROUP_LIST_0) self.assertEqual(l_xml.find('GroupNumber').text, TESTING_INSTEON_GROUP_NUM_0) self.assertEqual(l_xml.find('InsteonAddress').text, TESTING_INSTEON_ADDRESS_0) self.assertEqual(l_xml.find('ProductKey').text, TESTING_INSTEON_PRODUCT_KEY_0)
def test_03_Insteon(self): """Read the Insteon specific information. """ l_insteon = insteonXml._read_insteon(self.m_xml.light) self.assertEqual( conversions.int2dotted_hex(l_insteon.InsteonAddress, 3), TESTING_INSTEON_ADDRESS_0) self.assertEqual(conversions.int2dotted_hex(l_insteon.DevCat, 2), TESTING_INSTEON_DEVCAT_0) self.assertEqual(l_insteon.GroupList, TESTING_INSTEON_GROUP_LIST_0) self.assertEqual(l_insteon.GroupNumber, int(TESTING_INSTEON_GROUP_NUM_0)) self.assertEqual(conversions.int2dotted_hex(l_insteon.ProductKey, 3), TESTING_INSTEON_PRODUCT_KEY_0)
def test_03_InsteonLight(self): l_xml = self.m_core_api.write_core_lighting_xml('Light', self.m_light) insteonXml.WriteXml(l_xml, self.m_light) # print(PrettyFormatAny.form(l_xml, 'Lights XML')) self.assertEqual(l_xml.attrib['Name'], TESTING_LIGHT_NAME_0) self.assertEqual(l_xml.attrib['Key'], TESTING_LIGHT_KEY_0) self.assertEqual(l_xml.attrib['Active'], TESTING_LIGHT_ACTIVE_0) self.assertEqual(l_xml.find('Address').text, TESTING_INSTEON_ADDRESS_0) self.assertEqual(l_xml.find('DevCat').text, TESTING_INSTEON_DEVCAT_0) self.assertEqual( l_xml.find('GroupList').text, TESTING_INSTEON_GROUP_LIST_0) self.assertEqual( l_xml.find('GroupNumber').text, TESTING_INSTEON_GROUP_NUM_0) self.assertEqual( l_xml.find('ProductKey').text, TESTING_INSTEON_PRODUCT_KEY_0)
def test_01_ProductKey(self): l_product_key = insteonXml._read_product_key(self.m_xml.light) self.assertEqual(conversions.int2dotted_hex(l_product_key, 3), TESTING_INSTEON_PRODUCT_KEY_0)
def setUp(self): SetupMixin.setUp(self, ET.fromstring(XML_LONG)) self.m_light = self.m_core_api.read_core_lighting_xml( self.m_device, self.m_xml.light, self.m_version) insteonXml.ReadXml(self.m_light, self.m_xml.light)