issue-51-telegram refining

This commit is contained in:
2023-02-18 15:04:31 +01:00
parent 0a6316e155
commit 36705f99ca
6 changed files with 101 additions and 60 deletions
+4 -4
View File
@@ -338,10 +338,10 @@ class TelegramTest(unittest.TestCase):
self.assertEqual(obis_name, obis_name_mapping.EN[obis_references.P1_MESSAGE_HEADER])
self.assertEqual(dsmr_object.value, '50')
def test_get_mbus_devices(self):
def test_mbus_devices(self):
parser = TelegramParser(telegram_specifications.V5)
telegram = parser.parse(TELEGRAM_V5_TWO_MBUS)
mbus_devices = telegram.get_mbus_devices()
mbus_devices = telegram.MBUS_DEVICES
self.assertEqual(len(mbus_devices), 2)
@@ -373,12 +373,12 @@ class TelegramTest(unittest.TestCase):
parser = TelegramParser(telegram_specifications.V5, apply_checksum_validation=False)
telegram = parser.parse('')
self.assertEqual(telegram.get_mbus_devices(), [])
self.assertEqual(telegram.MBUS_DEVICES, [])
self.assertIsNone(telegram.get_mbus_device_by_channel(1))
# Because of a bug related to incorrect use of defaultdict,
# test again for unwanted side effects
self.assertEqual(telegram.get_mbus_devices(), [])
self.assertEqual(telegram.MBUS_DEVICES, [])
def test_to_json(self):
parser = TelegramParser(telegram_specifications.V5)
+1 -1
View File
@@ -213,7 +213,7 @@ class TelegramParserV5Test(unittest.TestCase):
# There's only one Mbus device (gas meter) in this case. Alternatively
# use get_mbget_mbus_device_by_channel
gas_meter_devices = telegram.get_mbus_devices()
gas_meter_devices = telegram.MBUS_DEVICES
gas_meter_device = gas_meter_devices[0]
# EQUIPMENT_IDENTIFIER_GAS (0-x:96.1.0)