Fix user presence by not overwriting error with OK() (#521)
* Fix user presence by not overwriting error with OK() * revert debugging change to TOUCH_TIMEOUT_MS * fix up incomplete merge * rename variable to more understandable name * Add tests to test user_presence
This commit is contained in:
@@ -341,16 +341,22 @@ class CancelTests(unittest.TestCase):
|
||||
self.fido,
|
||||
'https://example.com',
|
||||
user_interaction=CliInteraction(cid + 1, connection))
|
||||
# TODO(https://github.com/google/OpenSK/issues/519): This should be an
|
||||
# exception
|
||||
client.make_credential(self.create_options['publicKey'])
|
||||
with self.assertRaises(ClientError) as context:
|
||||
client.make_credential(self.create_options['publicKey'])
|
||||
|
||||
self.assertEqual(context.exception.code, ClientError.ERR.TIMEOUT)
|
||||
self.assertEqual(context.exception.cause.code,
|
||||
ctap.CtapError.ERR.USER_ACTION_TIMEOUT)
|
||||
|
||||
def test_timeout(self):
|
||||
client = Fido2Client(
|
||||
self.fido, 'https://example.com', user_interaction=CliInteraction())
|
||||
# TODO(https://github.com/google/OpenSK/issues/519): This should be an
|
||||
# exception
|
||||
client.make_credential(self.create_options['publicKey'])
|
||||
with self.assertRaises(ClientError) as context:
|
||||
client.make_credential(self.create_options['publicKey'])
|
||||
|
||||
self.assertEqual(context.exception.code, ClientError.ERR.TIMEOUT)
|
||||
self.assertEqual(context.exception.cause.code,
|
||||
ctap.CtapError.ERR.USER_ACTION_TIMEOUT)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
Reference in New Issue
Block a user