Fixing tests
This commit is contained in:
parent
1bf32ca641
commit
170cb736cb
4 changed files with 19 additions and 20 deletions
|
@ -15,8 +15,8 @@ from ecrterm.conv import bs2hl, toBytes, toHexString
|
|||
from ecrterm.exceptions import TransportLayerException
|
||||
from ecrterm.packets.apdu import Packets
|
||||
from ecrterm.packets.base_packets import (
|
||||
Authorisation, Completion, EndOfDay, Packet, PrintLine, Registration,
|
||||
ResetTerminal, ShowText, StatusEnquiry, StatusInformation)
|
||||
Authorisation, Completion, DisplayText, EndOfDay, Packet, PrintLine,
|
||||
Registration, ResetTerminal, StatusEnquiry, StatusInformation)
|
||||
from ecrterm.packets.bmp import BCD
|
||||
from ecrterm.transmission.signals import ACK, DLE, ETX, NAK, STX, TRANSMIT_OK
|
||||
from ecrterm.utils import is_stringlike
|
||||
|
@ -319,7 +319,7 @@ class ECR(object):
|
|||
for line in lines[:self.MAX_TEXT_LINES]:
|
||||
kw['line%s' % i] = line
|
||||
i += 1
|
||||
return self.transmit(ShowText(**kw))
|
||||
return self.transmit(DisplayText(**kw))
|
||||
|
||||
def status(self):
|
||||
"""
|
||||
|
|
|
@ -241,9 +241,9 @@ class APDUPacket(object):
|
|||
if isinstance(blob, list):
|
||||
# allright.
|
||||
# first we detect our packetclass
|
||||
Kls = Packets.detect(blob[:2])
|
||||
if Kls:
|
||||
instance = Kls()
|
||||
PacketClass = Packets.detect(blob[:2])
|
||||
if PacketClass:
|
||||
instance = PacketClass()
|
||||
# fix for multipackets:
|
||||
if instance.cmd_instr is None:
|
||||
instance.cmd_instr = blob[1]
|
||||
|
|
|
@ -252,7 +252,7 @@ Packets.register(Initialisation)
|
|||
# --- Text Related ---
|
||||
|
||||
|
||||
class ShowText(Packet):
|
||||
class DisplayText(Packet):
|
||||
"""
|
||||
06 E0
|
||||
chapters: bzt 3.2.26, pt 2.24
|
||||
|
@ -266,10 +266,10 @@ class ShowText(Packet):
|
|||
'line6', 'line7', 'line8', 'beeps']
|
||||
|
||||
|
||||
Packets.register(ShowText)
|
||||
Packets.register(DisplayText)
|
||||
|
||||
|
||||
class ShowTextIntInput(Packet):
|
||||
class DisplayTextIntInput(Packet):
|
||||
"""
|
||||
06 E2
|
||||
text output with numerical input.
|
||||
|
@ -277,7 +277,7 @@ class ShowTextIntInput(Packet):
|
|||
cmd_instr = 0xe2
|
||||
|
||||
|
||||
Packets.register(ShowTextIntInput)
|
||||
Packets.register(DisplayTextIntInput)
|
||||
|
||||
|
||||
class Completion(Packet):
|
||||
|
|
|
@ -17,9 +17,8 @@ from unittest import TestCase, main
|
|||
|
||||
from ecrterm.conv import toHexString
|
||||
from ecrterm.packets.base_packets import (
|
||||
Authorisation, Diagnosis, Initialisation, PacketReceived,
|
||||
PacketReceivedError, PrintLine, Registration, ResetTerminal, ShowText,
|
||||
StatusEnquiry)
|
||||
Authorisation, Diagnosis, DisplayText, Initialisation, PacketReceived,
|
||||
PacketReceivedError, PrintLine, Registration, ResetTerminal, StatusEnquiry)
|
||||
from ecrterm.transmission.signals import ACK, NAK
|
||||
from ecrterm.transmission.transport_serial import SerialMessage
|
||||
|
||||
|
@ -94,15 +93,15 @@ class TestCaseDataEncoding(TestCase):
|
|||
|
||||
def test_packet_showtext(self):
|
||||
data_expected = \
|
||||
'10 02 06 E0 25 F2 F1 F5 45 49 4E 47 45 42 45 4E 20 55 4E 44 20 ' \
|
||||
'4F 4B F1 F1 F6 46 41 48 52 45 52 4E 55 4D 4D 45 52 20 20 20 20 ' \
|
||||
'10 03 5A BA'
|
||||
lines = ['FAHRERNUMMER ', 'EINGEBEN UND OK', ]
|
||||
'10 02 06 E0 25 F1 F1 F6 46 41 48 52 45 52 4E 55 4D 4D 45 52 20 ' \
|
||||
'20 20 20 F2 F1 F5 45 49 4E 47 45 42 45 4E 20 55 4E 44 20 4F 4B ' \
|
||||
'10 03 DE CD'
|
||||
lines = ['FAHRERNUMMER ', 'EINGEBEN UND OK']
|
||||
# FAHRERNUMMER:
|
||||
# F1 F1 F6 46 41 48 52 45 52 4E 55 4D 4D 45 52 20 20 20 20
|
||||
# //FAHRERNUMMER
|
||||
# EINGEBEN UND OK:
|
||||
# F2 F1 F5 45 49 4E 47 45 42 45 4E 20 55 4E 44 20 4F 4B
|
||||
# //EINGEBEN UND OK
|
||||
pk = ShowText(
|
||||
pk = DisplayText(
|
||||
# display_duration=0,
|
||||
line1=lines[0],
|
||||
# beeps=5,
|
||||
|
|
Loading…
Reference in a new issue