diff --git a/appveyor.yml b/appveyor.yml index 1e010b7..02f9165 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -18,7 +18,7 @@ environment: - PYTHON: "C:\\Python36-x64" matrix: - fast_finish: true + fast_finish: false build_script: - pip install -e . diff --git a/fido_host/client.py b/fido_host/client.py index 1d1ce32..07011e7 100644 --- a/fido_host/client.py +++ b/fido_host/client.py @@ -372,6 +372,6 @@ class Fido2Client(object): ), auth_resp.signature )] - except ApduError as e: + except ApduError: pass # Ignore this handle raise CtapError(CtapError.ERR.NO_CREDENTIALS) diff --git a/fido_host/pyu2f/macos.py b/fido_host/pyu2f/macos.py index 9cc05fc..447aaed 100644 --- a/fido_host/pyu2f/macos.py +++ b/fido_host/pyu2f/macos.py @@ -111,13 +111,16 @@ K_CF_RUN_LOOP_RUN_STOPPED = 2 K_CF_RUN_LOOP_RUN_TIMED_OUT = 3 K_CF_RUN_LOOP_RUN_HANDLED_SOURCE = 4 -# Load relevant libraries -iokit = ctypes.cdll.LoadLibrary(ctypes.util.find_library('IOKit')) -cf = ctypes.cdll.LoadLibrary(ctypes.util.find_library('CoreFoundation')) +iokit = None +cf = None # Only use iokit and cf if we're on macos, this way we can still run tests # on other platforms if we properly mock if sys.platform.startswith('darwin'): + # Load relevant libraries + iokit = ctypes.cdll.LoadLibrary(ctypes.util.find_library('IOKit')) + cf = ctypes.cdll.LoadLibrary(ctypes.util.find_library('CoreFoundation')) + # Exported constants K_CF_RUNLOOP_DEFAULT_MODE = CF_STRING_REF.in_dll(cf, 'kCFRunLoopDefaultMode') diff --git a/test/test_hid.py b/test/test_hid.py index 7a3637d..7681ef0 100644 --- a/test/test_hid.py +++ b/test/test_hid.py @@ -43,6 +43,6 @@ class HidTest(unittest.TestCase): msg2 = b' ' msg3 = b'' dev = self.get_device() - self.assertEqual(dev.ping(0x40, 0, 0, msg1), msg1) - self.assertEqual(dev.ping(0x40, 0, 0, msg2), msg2) - self.assertEqual(dev.ping(0x40, 0, 0, msg3), msg3) + self.assertEqual(dev.ping(msg1), msg1) + self.assertEqual(dev.ping(msg2), msg2) + self.assertEqual(dev.ping(msg3), msg3)