def test_update_devices_exception_with_none_device(self): location = Location(smart_system=self.smart_system_test_info) location.update_information(location_return) location.update_devices() assert self.m_devices.call_count == 1 assert len(location.gateways) == 1 assert len(location.mowers) == 1 assert len(location.sensors) == 1 assert len(location.water_controls) == 1 assert len(location.powers) == 1 location.add_or_update_device() assert len(location.gateways) == 1 assert len(location.mowers) == 1 assert len(location.sensors) == 1 assert len(location.water_controls) == 1 assert len(location.powers) == 1
def test_update_devices_unknown_category(self): location = Location(smart_system=self.smart_system_test_info) location.update_information(location_return) location.update_devices() assert self.m_devices.call_count == 1 assert len(location.gateways) == 1 assert len(location.mowers) == 1 assert len(location.sensors) == 1 assert len(location.water_controls) == 1 assert len(location.powers) == 1 location.add_or_update_device( device={ "id": "75cfc1f8-a20c-51d6-c5ea-1b5eccce80c1", "name": "Unknown device", "description": "Unknown device", "category": "unknown_category", } ) assert len(location.gateways) == 1 assert len(location.mowers) == 1 assert len(location.sensors) == 1 assert len(location.water_controls) == 1 assert len(location.powers) == 1