Progress on removing TelegramParserV2_2 and TelegramParserV4 in favor of a generic TelegramParser

This commit is contained in:
Nigel Dokter
2017-01-20 23:02:19 +01:00
parent e2e4bb36a2
commit 07634abed1
7 changed files with 70 additions and 128 deletions

View File

@@ -1,16 +1,16 @@
import unittest
from test.example_telegrams import TELEGRAM_V2_2
from dsmr_parser.parsers import TelegramParserV2_2
from dsmr_parser.parsers import TelegramParser
from dsmr_parser import telegram_specifications
from dsmr_parser import obis_references as obis
from test.example_telegrams import TELEGRAM_V2_2
class TelegramParserV2_2Test(unittest.TestCase):
""" Test parsing of a DSMR v2.2 telegram. """
def test_parse(self):
parser = TelegramParserV2_2(telegram_specifications.V2_2)
parser = TelegramParser(telegram_specifications.V2_2)
result = parser.parse(TELEGRAM_V2_2)
assert float(result[obis.CURRENT_ELECTRICITY_USAGE].value) == 1.01