From bce6f497711e47cc3b442e073c8f26463d679337 Mon Sep 17 00:00:00 2001 From: Peter Lemenkov Date: Wed, 15 May 2024 12:49:54 +0200 Subject: [PATCH] Fixes for pyparsing 3.1.2 - Fix tests output - Bump dependency version Fixes #167. Signed-off-by: Peter Lemenkov --- requirements.txt | 2 +- setup.py | 2 +- tests/test_parse.py | 22 +++++++++++----------- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/requirements.txt b/requirements.txt index e65917b..98a93a0 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -pyparsing>=3.0.6,<3.1 +pyparsing>=3.1.2 codespell pyasn1 asn1crypto diff --git a/setup.py b/setup.py index ddb42a9..a79e2ee 100755 --- a/setup.py +++ b/setup.py @@ -27,7 +27,7 @@ def find_version(): url='https://github.com/eerimoq/asn1tools', packages=find_packages(exclude=['tests']), install_requires=[ - 'pyparsing>=3.0.6', + 'pyparsing>=3.1.2', 'bitstruct' ], extras_require={ diff --git a/tests/test_parse.py b/tests/test_parse.py index f5ac129..cfadf83 100644 --- a/tests/test_parse.py +++ b/tests/test_parse.py @@ -332,8 +332,8 @@ def test_parse_error_sequence_missing_type(self): self.assertEqual( str(cm.exception), - "Invalid ASN.1 syntax at line 1, column 43: 'A DEFINITIONS ::= BEGIN " - " A ::= SEQUENCE { >!!<} END': Expected Type.") def test_parse_error_sequence_missing_member_name(self): with self.assertRaises(asn1tools.ParseError) as cm: @@ -344,7 +344,7 @@ def test_parse_error_sequence_missing_member_name(self): self.assertEqual( str(cm.exception), "Invalid ASN.1 syntax at line 1, column 43: 'A DEFINITIONS ::= " - "BEGIN A ::= SEQUENCE { >!!!<(| SIZE (1))END': Expected END.") + "Invalid ASN.1 syntax at line 1, column 40: 'A DEFINITIONS ::= BEGIN " + "B ::= INTEGER (>!<| SIZE (1))END': Expected one or more constraints.") def test_parse_error_missing_union_member_middle(self): with self.assertRaises(asn1tools.ParseError) as cm: @@ -377,8 +377,8 @@ def test_parse_error_missing_union_member_middle(self): self.assertEqual( str(cm.exception), - "Invalid ASN.1 syntax at line 1, column 39: \'A DEFINITIONS " - "::= BEGIN B ::= INTEGER >!<(SIZE (1) | | (0))END\': Expected END.") + "Invalid ASN.1 syntax at line 1, column 49: \'A DEFINITIONS " + "::= BEGIN B ::= INTEGER (SIZE (1) >!<| | (0))END\': Expected ')'.") def test_parse_error_missing_union_member_end(self): with self.assertRaises(asn1tools.ParseError) as cm: @@ -388,8 +388,8 @@ def test_parse_error_missing_union_member_end(self): self.assertEqual( str(cm.exception), - "Invalid ASN.1 syntax at line 1, column 39: \'A DEFINITIONS " - "::= BEGIN B ::= INTEGER >!<(SIZE (1) |)END\': Expected END.") + "Invalid ASN.1 syntax at line 1, column 49: \'A DEFINITIONS " + "::= BEGIN B ::= INTEGER (SIZE (1) >!<|)END\': Expected ')'.") def test_parse_error_size_constraint_missing_parentheses(self): with self.assertRaises(asn1tools.ParseError) as cm: @@ -463,7 +463,7 @@ def test_parse_error_late_extension_additions(self): str(cm.exception), "Invalid ASN.1 syntax at line 1, column 63: \'A DEFINITIONS ::= " "BEGIN Foo ::= SEQUENCE { a BOOLEAN, ..., ...>!<, [[ c BOOLEAN ]] " - "} END\': Expected Type.") + "} END\': Expected '}'.") def test_parse_error_too_many_extension_markers(self): with self.assertRaises(asn1tools.ParseError) as cm: @@ -487,7 +487,7 @@ def test_parse_error_too_many_extension_markers(self): str(cm.exception), "Invalid ASN.1 syntax at line 1, column 108: \'A DEFINITIONS ::= " "BEGIN Foo ::= SEQUENCE { a BOOLEAN, ..., [[ b BOOLEAN ]], [[ c " - "BOOLEAN ]], ..., d BOOLEAN>!<, ... } END\': Expected Type.") + "BOOLEAN ]], ..., d BOOLEAN>!<, ... } END\': Expected '}'.") def test_parse_error_missing_single_line_comment_end(self): with self.assertRaises(asn1tools.ParseError) as cm: