summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin Krahl <robin.krahl@ireas.org>2019-01-20 21:35:19 +0000
committerRobin Krahl <robin.krahl@ireas.org>2019-01-20 22:36:27 +0100
commit07bb11fec9de6579ffaa8d128796f242f818292f (patch)
treec101583dde2a0436b7f0b54a6f64a3a967ad594b
parent8c57d3ace0215adb3cd5edd0f18e8cc513f65ff1 (diff)
downloadnitrokey-rs-07bb11fec9de6579ffaa8d128796f242f818292f.tar.gz
nitrokey-rs-07bb11fec9de6579ffaa8d128796f242f818292f.tar.bz2
Fix formatting in tests
-rw-r--r--tests/device.rs30
-rw-r--r--tests/pws.rs10
2 files changed, 32 insertions, 8 deletions
diff --git a/tests/device.rs b/tests/device.rs
index c502945..0431f8b 100644
--- a/tests/device.rs
+++ b/tests/device.rs
@@ -32,10 +32,19 @@ fn count_nitrokey_block_devices() -> usize {
#[test_device]
fn connect_no_device() {
assert_cmu_err!(CommunicationError::NotConnected, nitrokey::connect());
- assert_cmu_err!(CommunicationError::NotConnected, nitrokey::connect_model(nitrokey::Model::Pro));
- assert_cmu_err!(CommunicationError::NotConnected, nitrokey::connect_model(nitrokey::Model::Storage));
+ assert_cmu_err!(
+ CommunicationError::NotConnected,
+ nitrokey::connect_model(nitrokey::Model::Pro)
+ );
+ assert_cmu_err!(
+ CommunicationError::NotConnected,
+ nitrokey::connect_model(nitrokey::Model::Storage)
+ );
assert_cmu_err!(CommunicationError::NotConnected, nitrokey::Pro::connect());
- assert_cmu_err!(CommunicationError::NotConnected, nitrokey::Storage::connect());
+ assert_cmu_err!(
+ CommunicationError::NotConnected,
+ nitrokey::Storage::connect()
+ );
}
#[test_device]
@@ -170,7 +179,10 @@ fn change_admin_pin(device: DeviceWrapper) {
let device = device.authenticate_admin(ADMIN_PASSWORD).unwrap().device();
let device = device.authenticate_admin(ADMIN_NEW_PASSWORD).unwrap_err().0;
- assert_ok!((), device.change_admin_pin(ADMIN_PASSWORD, ADMIN_NEW_PASSWORD));
+ assert_ok!(
+ (),
+ device.change_admin_pin(ADMIN_PASSWORD, ADMIN_NEW_PASSWORD)
+ );
let device = device.authenticate_admin(ADMIN_PASSWORD).unwrap_err().0;
let device = device
@@ -183,7 +195,10 @@ fn change_admin_pin(device: DeviceWrapper) {
device.change_admin_pin(ADMIN_PASSWORD, ADMIN_PASSWORD)
);
- assert_ok!((), device.change_admin_pin(ADMIN_NEW_PASSWORD, ADMIN_PASSWORD));
+ assert_ok!(
+ (),
+ device.change_admin_pin(ADMIN_NEW_PASSWORD, ADMIN_PASSWORD)
+ );
let device = device.authenticate_admin(ADMIN_PASSWORD).unwrap().device();
device.authenticate_admin(ADMIN_NEW_PASSWORD).unwrap_err();
@@ -239,7 +254,10 @@ fn unlock_user_pin(device: DeviceWrapper) {
CommandError::WrongPassword,
device.unlock_user_pin(USER_PASSWORD, USER_PASSWORD)
);
- assert_ok!((), device.unlock_user_pin(ADMIN_PASSWORD, USER_NEW_PASSWORD));
+ assert_ok!(
+ (),
+ device.unlock_user_pin(ADMIN_PASSWORD, USER_NEW_PASSWORD)
+ );
// reset user PIN
assert_ok!((), device.change_user_pin(USER_NEW_PASSWORD, USER_PASSWORD));
diff --git a/tests/pws.rs b/tests/pws.rs
index 7a97983..8bdf532 100644
--- a/tests/pws.rs
+++ b/tests/pws.rs
@@ -39,9 +39,15 @@ where
#[test_device]
fn enable(device: DeviceWrapper) {
- assert_cmd_err!(CommandError::WrongPassword, device.get_password_safe(&(USER_PASSWORD.to_owned() + "123")));
+ assert_cmd_err!(
+ CommandError::WrongPassword,
+ device.get_password_safe(&(USER_PASSWORD.to_owned() + "123"))
+ );
assert!(device.get_password_safe(USER_PASSWORD).is_ok());
- assert_cmd_err!(CommandError::WrongPassword, device.get_password_safe(ADMIN_PASSWORD));
+ assert_cmd_err!(
+ CommandError::WrongPassword,
+ device.get_password_safe(ADMIN_PASSWORD)
+ );
assert!(device.get_password_safe(USER_PASSWORD).is_ok());
}