Skip to content

Commit

Permalink
Fixes for pyparsing 3.1.2
Browse files Browse the repository at this point in the history
- Fix tests output
- Bump dependency version

Fixes #167.

Signed-off-by: Peter Lemenkov <lemenkov@gmail.com>
  • Loading branch information
lemenkov authored and eerimoq committed Jul 13, 2024
1 parent c890898 commit bce6f49
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pyparsing>=3.0.6,<3.1
pyparsing>=3.1.2
codespell
pyasn1
asn1crypto
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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={
Expand Down
22 changes: 11 additions & 11 deletions tests/test_parse.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 { >!<a } END': Expected Type.")
"Invalid ASN.1 syntax at line 1, column 45: 'A DEFINITIONS ::= BEGIN "
" A ::= SEQUENCE { a >!<} END': Expected Type.")

def test_parse_error_sequence_missing_member_name(self):
with self.assertRaises(asn1tools.ParseError) as cm:
Expand All @@ -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 { >!<A } END': Expected Type.")
"BEGIN A ::= SEQUENCE { >!<A } END': Expected '}'.")

def test_parse_error_definitive_identifier(self):
with self.assertRaises(asn1tools.ParseError) as cm:
Expand All @@ -366,8 +366,8 @@ def test_parse_error_missing_union_member_beginning(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 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:
Expand All @@ -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:
Expand All @@ -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:
Expand Down Expand Up @@ -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:
Expand All @@ -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:
Expand Down

0 comments on commit bce6f49

Please sign in to comment.