aboutsummaryrefslogtreecommitdiff
path: root/src/tests/otp.rs
diff options
context:
space:
mode:
authorDaniel Mueller <deso@posteo.net>2020-07-09 18:57:18 -0700
committerDaniel Mueller <deso@posteo.net>2020-07-09 18:57:18 -0700
commitc461a506f6bf3bf73374df289298879ba9d2d125 (patch)
tree93e2f31400a71b73057b93ecb62279a47d7c80d0 /src/tests/otp.rs
parentefb6fbffdb96c6acd197b8a7c4fe0ed9855a151e (diff)
downloadnitrocli-c461a506f6bf3bf73374df289298879ba9d2d125.tar.gz
nitrocli-c461a506f6bf3bf73374df289298879ba9d2d125.tar.bz2
Remove unwrap_lib_err method from UnwrapError test trait
This change marks the next step in getting rid of the UnwrapError test trait. Specifically, it removes its unwrap_lib_err method.
Diffstat (limited to 'src/tests/otp.rs')
-rw-r--r--src/tests/otp.rs17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/tests/otp.rs b/src/tests/otp.rs
index 837b075..8802d9e 100644
--- a/src/tests/otp.rs
+++ b/src/tests/otp.rs
@@ -33,15 +33,16 @@ fn set_invalid_slot_raw(model: nitrokey::Model) {
#[test_device]
fn set_invalid_slot(model: nitrokey::Model) {
- let res = Nitrocli::with_model(model).handle(&["otp", "set", "100", "name", "1234", "-f", "hex"]);
-
- assert_eq!(
- res.unwrap_lib_err(),
- (
- Some("Could not write OTP slot"),
- nitrokey::LibraryError::InvalidSlot
- )
+ let err = Nitrocli::with_model(model)
+ .handle(&["otp", "set", "100", "name", "1234", "-f", "hex"])
+ .unwrap_err()
+ .to_string();
+ let expected = format!(
+ "Could not write OTP slot: {}",
+ nitrokey::Error::LibraryError(nitrokey::LibraryError::InvalidSlot)
);
+
+ assert_eq!(err, expected);
}
#[test_device]