fix tox tests

This commit is contained in:
Hans Erik van Elburg 2020-12-24 01:52:17 +01:00
parent 5b1e830018
commit 81cccbd228
4 changed files with 5 additions and 8 deletions

View File

@ -225,8 +225,6 @@ class ProfileGenericParser(DSMRObjectParser):
self.parsers_for_unidentified = parsers_for_unidentified
def _is_line_wellformed(self, line, values):
if values and (len(values) == 1) and (values[0] == ''):
# special case: single empty parentheses (indicated by empty string)
return True
@ -238,7 +236,7 @@ class ProfileGenericParser(DSMRObjectParser):
return False
def _parse_values(self, values):
if values and (len(values) == 1) and (values[0] == None):
if values and (len(values) == 1) and (values[0] is None):
# special case: single empty parentheses; make sure empty ProfileGenericObject is created
values = [0, None] # buffer_length=0, buffer_value_obis_ID=None
buffer_length = int(values[0])

View File

@ -241,7 +241,6 @@ class TelegramParserV5Test(unittest.TestCase):
def test_checksum_missing(self):
# Remove the checksum value causing a ParseError.
corrupted_telegram = TELEGRAM_V5.replace('!87B3\r\n', '')
corrupted_telegram = TELEGRAM_V5.replace('!6EEE\r\n', '')
with self.assertRaises(ParseError):
TelegramParser.validate_checksum(corrupted_telegram)