File tree Expand file tree Collapse file tree 3 files changed +14
-1
lines changed Expand file tree Collapse file tree 3 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
13
13
- BREAKING CHANGE: Segment() calls * must* provide the tag name now as the first parameter.
14
14
- change plugin system from ` metaclass ` to ` __init_subclass__ `
15
15
- raise ValidationError, not AssertionError, when ServiceAdviceString is not 6 chars long
16
+ - Drop support for Python versions < 3.10 (3.8 was EOL 2024-10-07, 3.9 not much used in Distros.)
17
+
16
18
### ADDED
17
19
- massively improve type annotations (thanks Tammo Ippen)
18
20
- use code-based structures to validate segments and data elements
Original file line number Diff line number Diff line change @@ -287,3 +287,13 @@ def test_edifact_text_with_newlines():
287
287
assert len (segments ) == 12
288
288
segments = list (Parser ().parse ("UNA:+,? '" + example_text ))
289
289
assert len (segments ) == 13
290
+
291
+
292
+ def test_edifact_text_with_newline_at_end ():
293
+ example_text = """UNB+IBMA:1+FACHARZT A+PRAKTIKER X+950402+1200+1'
294
+ UNH+000001+MEDRPT:1:901:UN'
295
+ UNT+7+000001'
296
+ UNZ+2+1'
297
+ """
298
+ segments = list (Parser ().parse (example_text ))
299
+ assert len (segments ) == 4
Original file line number Diff line number Diff line change @@ -192,11 +192,12 @@ def test_escaped_newline_char():
192
192
)
193
193
)
194
194
assert "Newlines after escape characters are not allowed." in str (excinfo .value )
195
+ assert "line 0, column 5" in str (excinfo .value )
195
196
196
197
# a "\n" must do the same as a real newline
197
198
with pytest .raises (EdifactSyntaxError ) as excinfo :
198
199
# must raise a EdifactSyntaxError as there is no newline after an escape char
199
200
# "?" allowed.
200
201
list (Tokenizer ().get_tokens ("UNB+?\n FOO'" ))
201
202
assert "Newlines after escape characters are not allowed." in str (excinfo .value )
202
- assert "Unexpected end of EDI messages. " in str (excinfo .value )
203
+ assert "line 0, column 5 " in str (excinfo .value )
You can’t perform that action at this time.
0 commit comments