-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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.
- Loading branch information
Showing
3 changed files
with
19 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
// pws.rs | ||
|
||
// ************************************************************************* | ||
// * Copyright (C) 2019 Daniel Mueller ([email protected]) * | ||
// * Copyright (C) 2019-2020 Daniel Mueller ([email protected]) * | ||
// * * | ||
// * This program is free software: you can redistribute it and/or modify * | ||
// * it under the terms of the GNU General Public License as published by * | ||
|
@@ -21,15 +21,16 @@ use super::*; | |
|
||
#[test_device] | ||
fn set_invalid_slot(model: nitrokey::Model) { | ||
let res = Nitrocli::with_model(model).handle(&["pws", "set", "100", "name", "login", "1234"]); | ||
|
||
assert_eq!( | ||
res.unwrap_lib_err(), | ||
( | ||
Some("Could not write PWS slot"), | ||
nitrokey::LibraryError::InvalidSlot | ||
) | ||
let err = Nitrocli::with_model(model) | ||
.handle(&["pws", "set", "100", "name", "login", "1234"]) | ||
.unwrap_err() | ||
.to_string(); | ||
let expected = format!( | ||
"Could not write PWS slot: {}", | ||
nitrokey::Error::LibraryError(nitrokey::LibraryError::InvalidSlot) | ||
); | ||
|
||
assert_eq!(err, expected); | ||
} | ||
|
||
#[test_device] | ||
|