tests/card_reader.py: Ignore CCID devices which report card absence.

Helps running tests on computers which have a "real" card reader in
addition to the ICC to be tested.
This commit is contained in:
Vincent Pelletier
2021-01-05 00:17:30 +00:00
committed by NIIBE Yutaka
parent c688df7c2c
commit 5283506755

View File

@@ -129,6 +129,9 @@ class CardReader(object):
self.__timeout = 100000 self.__timeout = 100000
self.__seq = 0 self.__seq = 0
if self.ccid_get_status() & 0x03 not in (0, 1):
raise ValueError("Card absent")
def get_string(self, num): def get_string(self, num):
return get_string(self.__dev, num) return get_string(self.__dev, num)