Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes for pyparsing 3.1.2 #185

Merged
merged 1 commit into from
Jul 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading