fix some errors in tests

This commit is contained in:
merlokk 2019-07-04 20:09:47 +03:00
parent d1df8b8b77
commit 151e1d0e9b

View File

@ -51,6 +51,7 @@ class Tester:
self.host = "examplo.org" self.host = "examplo.org"
self.user_count = 10 self.user_count = 10
self.is_sim = False self.is_sim = False
self.nfc_interface_only = False;
if tester: if tester:
self.initFromTester(tester) self.initFromTester(tester)
@ -61,9 +62,11 @@ class Tester:
self.ctap = tester.ctap self.ctap = tester.ctap
self.ctap1 = tester.ctap1 self.ctap1 = tester.ctap1
self.client = tester.client self.client = tester.client
self.nfc_interface_only = tester.nfc_interface_only
def find_device(self, nfcInterfaceOnly=False): def find_device(self, nfcInterfaceOnly=False):
dev = None dev = None
self.nfc_interface_only = nfcInterfaceOnly
if not nfcInterfaceOnly: if not nfcInterfaceOnly:
print("--- HID ---") print("--- HID ---")
print(list(CtapHidDevice.list_devices())) print(list(CtapHidDevice.list_devices()))
@ -102,7 +105,7 @@ class Tester:
else: else:
print("Please reboot authentictor and hit enter") print("Please reboot authentictor and hit enter")
input() input()
self.find_device() self.find_device(self.nfc_interface_only)
def send_data(self, cmd, data): def send_data(self, cmd, data):
if not isinstance(data, bytes): if not isinstance(data, bytes):
@ -196,7 +199,7 @@ class Tester:
print("You must power cycle authentictor. Hit enter when done.") print("You must power cycle authentictor. Hit enter when done.")
input() input()
time.sleep(0.2) time.sleep(0.2)
self.find_device() self.find_device(self.nfc_interface_only)
self.ctap.reset() self.ctap.reset()
def testMC(self, test, *args, **kwargs): def testMC(self, test, *args, **kwargs):