diff options
author | Robin Krahl <robin.krahl@ireas.org> | 2019-01-09 15:13:08 +0000 |
---|---|---|
committer | Robin Krahl <robin.krahl@ireas.org> | 2019-01-09 16:16:43 +0100 |
commit | eb1960b1dbaa4432eb65c7f00689146c815db823 (patch) | |
tree | 2b69161c6be4fdf626ab3834fdba554b6667f088 /tests/otp.rs | |
parent | a849924327cc6c07620fa993e4092768829542e0 (diff) | |
download | nitrokey-rs-eb1960b1dbaa4432eb65c7f00689146c815db823.tar.gz nitrokey-rs-eb1960b1dbaa4432eb65c7f00689146c815db823.tar.bz2 |
Fix otp::totp_error test case
Previously the totp_error test case in the otp test suite called hotp
methods. This patch fixes the test case by calling totp metods instead.
Diffstat (limited to 'tests/otp.rs')
-rw-r--r-- | tests/otp.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/otp.rs b/tests/otp.rs index 2b46088..fcf0020 100644 --- a/tests/otp.rs +++ b/tests/otp.rs @@ -256,17 +256,17 @@ fn totp_slot_name(device: DeviceWrapper) { #[test_device] fn totp_error(device: DeviceWrapper) { let admin = make_admin_test_device(device); - let slot_data = OtpSlotData::new(1, "", HOTP_SECRET, OtpMode::SixDigits); + let slot_data = OtpSlotData::new(1, "", TOTP_SECRET, OtpMode::SixDigits); assert_eq!( Err(CommandError::NoName), - admin.write_hotp_slot(slot_data, 0) + admin.write_totp_slot(slot_data, 0) ); - let slot_data = OtpSlotData::new(4, "test", HOTP_SECRET, OtpMode::SixDigits); + let slot_data = OtpSlotData::new(20, "test", TOTP_SECRET, OtpMode::SixDigits); assert_eq!( Err(CommandError::InvalidSlot), - admin.write_hotp_slot(slot_data, 0) + admin.write_totp_slot(slot_data, 0) ); - let code = admin.get_hotp_code(4); + let code = admin.get_totp_code(20); assert_eq!(CommandError::InvalidSlot, code.unwrap_err()); } |