Exemple #1
0
    def test_build_attributes_none(self):

        test_obj = DeviceObject()
        test_obj.m_device = Device()
        test_obj._build_attributes()

        self.assertIsNone(test_obj.id)
        self.assertIsNone(test_obj.name)
        self.assertIsNone(test_obj.interface)
        self.assertIsNone(test_obj.implementation)
Exemple #2
0
    def _build_attributes(self):
        if self.m_measurement.id:
            self.id = self.m_measurement.id
        if self.m_measurement.timestamp:
            self.timestamp = self.m_measurement.timestamp

        if self.m_measurement.base_device:
            dev_obj = DeviceObject()
            dev_obj.m_device = self.m_measurement.base_device
            dev_obj._build_attributes()
            self.device = dev_obj

        if self.m_measurement.cpm:
            self.cpm = self.m_measurement.cpm
        if self.m_measurement.svh:
            self.svh = self.m_measurement.svh