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 #10 from wirelane/feature/enquire_if_pre_authoriza…
…tions_exist add support for OpenReservationsEnquiry (Enquire if Pre-Authorisations exist (06 23))
- Loading branch information
Showing
7 changed files
with
171 additions
and
17 deletions.
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
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
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
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,21 @@ | ||
from unittest import TestCase, main | ||
|
||
from ecrterm.common import TERMINAL_STATUS_CODES | ||
from ecrterm.ecr import parse_represented_data | ||
from ecrterm.packets.base_packets import Completion | ||
|
||
|
||
class TestParsingCompletion(TestCase): | ||
|
||
def test_completion(self): | ||
packet = '060f89f0f4f04745522d4150502d76322e302e393b635230322e30312e30312d30302e30392d322d323b4343323600065b1f440452500245e4431f400a6356454e4420626f782b1f41284745522d4150502d76322e302e393b635230322e30312e30312d30302e30392d322d323b434332361f420411e930ec1f430100340d1f0e04202306221f0f03085556' | ||
|
||
parsed = parse_represented_data(packet) | ||
self.assertIsInstance(parsed, Completion) | ||
self.assertEqual(parsed.get_serial_number(), '11e930ec') | ||
self.assertEqual(parsed.sw_version, 'GER-APP-v2.0.9;cR02.01.01-00.09-2-2;CC26') | ||
self.assertEqual(TERMINAL_STATUS_CODES.get(parsed.terminal_status), 'PT ready') | ||
|
||
|
||
if __name__ == '__main__': | ||
main() |
Oops, something went wrong.