forked from henryk/ecrterm
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #18 from wirelane/feature/add_extended_error_code
add extended_error_code + bump version
- Loading branch information
Showing
3 changed files
with
26 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
__version__ = '1.0.7' | ||
__version__ = '1.0.8' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
from unittest import TestCase, main | ||
|
||
from ecrterm.ecr import parse_represented_data | ||
from ecrterm.packets.base_packets import Abort | ||
|
||
|
||
class TestParsingAbort(TestCase): | ||
|
||
def test_abort_by_external_command(self): | ||
packet = '061e2e6c062b1f1605ff000014411f1720416262727563682064757263682065787465726e6573204b6f6d6d616e646f21' | ||
parsed = parse_represented_data(packet) | ||
|
||
print(parsed) | ||
|
||
self.assertIsInstance(parsed, Abort) | ||
self.assertEqual(108, parsed.result_code) | ||
tlv = parsed.get('tlv') | ||
self.assertIsNotNone(tlv) | ||
extended_error_code = tlv.get_value('extended_error_code') | ||
self.assertEqual('ff00001441', extended_error_code) | ||
|
||
|
||
if __name__ == '__main__': | ||
main() |