From 52835067554165180a02e441635824e39004616f Mon Sep 17 00:00:00 2001 From: Vincent Pelletier Date: Tue, 5 Jan 2021 00:17:30 +0000 Subject: [PATCH] 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. --- tests/card_reader.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/card_reader.py b/tests/card_reader.py index df85c38..ecf4021 100644 --- a/tests/card_reader.py +++ b/tests/card_reader.py @@ -129,6 +129,9 @@ class CardReader(object): self.__timeout = 100000 self.__seq = 0 + if self.ccid_get_status() & 0x03 not in (0, 1): + raise ValueError("Card absent") + def get_string(self, num): return get_string(self.__dev, num)