def test_03_All(self): """ Did we get everything set up for the rest of the tests of this class. """ l_in_xml = self.m_xml.light l_device = self.m_device_obj l_light = LightingCoreAPI.read_core_lighting_xml(l_device, l_in_xml, self.m_version) FamUtil.read_family_data(self.m_pyhouse_obj, l_light, l_in_xml) l_out_xml = LightingCoreAPI.write_core_lighting_xml("Light", l_light) FamUtil.write_family_data(self.m_pyhouse_obj, l_out_xml, l_light) self.assertEqual(l_light.Name, TESTING_LIGHTING_LIGHTS_NAME_1) self.assertEqual(l_light.DeviceFamily, TESTING_DEVICE_FAMILY_INSTEON) self.assertEqual(l_light.InsteonAddress, conversions.dotted_hex2int(TESTING_INSTEON_ADDRESS_0))
def test_02_All(self): """ Did we get everything set up for the rest of the tests of this class. """ l_in_xml = self.m_xml.light l_device = self.m_device_obj l_light = LightingCoreAPI.read_core_lighting_xml( self.m_pyhouse_obj, l_device, l_in_xml) FamUtil.read_family_data(self.m_pyhouse_obj, l_light, l_in_xml) l_out_xml = LightingCoreAPI.write_core_lighting_xml('Light', l_light) FamUtil.write_family_data(self.m_pyhouse_obj, l_out_xml, l_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_01_Interface(self): l_ctlr = self.m_xml.controller_sect[1] l_device = ControllerData() l_obj = lightingcoreAPI.read_core_lighting_xml(l_device, l_ctlr, self.m_version) L_interface = usbXML.read_interface_xml(l_ctlr) stuff_new_attrs(l_obj, L_interface) # l_xml = lightingcoreAPI.write_core_lighting_xml('TestController', l_obj) usbXML.write_interface_xml(l_xml, l_obj) print(PrettyFormatAny.form(l_xml, 'XML')) self.assertEqual(l_xml.attrib['Name'], TESTING_CONTROLLER_NAME_1) self.assertEqual(l_xml.attrib['Key'], TESTING_CONTROLLER_KEY_1) self.assertEqual(l_xml.attrib['Active'], TESTING_CONTROLLER_ACTIVE_1) self.assertEqual(l_xml.find('Vendor').text, TESTING_USB_VENDOR) self.assertEqual(l_xml.find('Product').text, TESTING_USB_PRODUCT)
def test_01_Interface(self): l_ctlr = self.m_xml.controller_sect[1] l_device = ControllerData() l_obj = lightingcoreAPI.read_core_lighting_xml(l_device, l_ctlr, self.m_version) L_interface = usbXML.read_interface_xml(l_ctlr) stuff_new_attrs(l_obj, L_interface) # l_xml = lightingcoreAPI.write_core_lighting_xml( 'TestController', l_obj) usbXML.write_interface_xml(l_xml, l_obj) print(PrettyFormatAny.form(l_xml, 'XML')) self.assertEqual(l_xml.attrib['Name'], TESTING_CONTROLLER_NAME_1) self.assertEqual(l_xml.attrib['Key'], TESTING_CONTROLLER_KEY_1) self.assertEqual(l_xml.attrib['Active'], TESTING_CONTROLLER_ACTIVE_1) self.assertEqual(l_xml.find('Vendor').text, TESTING_USB_VENDOR) self.assertEqual(l_xml.find('Product').text, TESTING_USB_PRODUCT)
def _write_base_device(p_obj): l_xml = LightingCoreAPI.write_core_lighting_xml('Controller', p_obj) return l_xml
def _write_base_device(p_obj): l_xml = LightingCoreAPI.write_core_lighting_xml('Button', p_obj) return l_xml
def _write_base_device(p_pyhouse_obj, p_light_obj): l_xml = LightingCoreAPI.write_core_lighting_xml('Light', p_light_obj) return l_xml
def _write_base_device(_p_pyhouse_obj, p_light_obj): l_xml = LightingCoreAPI.write_core_lighting_xml('Light', p_light_obj) return l_xml