diff options
author | Robin Krahl <robin.krahl@ireas.org> | 2019-01-23 04:56:43 +0000 |
---|---|---|
committer | Robin Krahl <robin.krahl@ireas.org> | 2019-01-23 05:57:11 +0100 |
commit | 35fd6be074cd16796f701770845ade471e2c13bd (patch) | |
tree | 96087f102b5295f08f71507ab1eed2ce4c8cf808 | |
parent | b00bbaa5603504597729ed2ce0d1e8ff50ea078d (diff) | |
download | nitrokey-rs-35fd6be074cd16796f701770845ade471e2c13bd.tar.gz nitrokey-rs-35fd6be074cd16796f701770845ade471e2c13bd.tar.bz2 |
Refactor device::config test case
-rw-r--r-- | TODO.md | 1 | ||||
-rw-r--r-- | tests/device.rs | 10 |
2 files changed, 4 insertions, 7 deletions
@@ -7,7 +7,6 @@ - `NK_connect_with_ID` - Fix timing issues with the `totp_no_pin` and `totp_pin` test cases. - Clear passwords from memory. -- Find a nicer syntax for the `write_config` test. - Lock password safe in `PasswordSafe::drop()` (see [nitrokey-storage-firmware issue 65][]). - Disable creation of multiple password safes at the same time. diff --git a/tests/device.rs b/tests/device.rs index 0431f8b..59c9348 100644 --- a/tests/device.rs +++ b/tests/device.rs @@ -133,23 +133,21 @@ fn get_retry_count(device: DeviceWrapper) { #[test_device] fn config(device: DeviceWrapper) { let admin = device.authenticate_admin(ADMIN_PASSWORD).unwrap(); + let config = Config::new(None, None, None, true); assert_ok!((), admin.write_config(config)); - let get_config = admin.get_config().unwrap(); - assert_eq!(config, get_config); + assert_ok!(config, admin.get_config()); let config = Config::new(None, Some(9), None, true); assert_lib_err!(LibraryError::InvalidSlot, admin.write_config(config)); let config = Config::new(Some(1), None, Some(0), false); assert_ok!((), admin.write_config(config)); - let get_config = admin.get_config().unwrap(); - assert_eq!(config, get_config); + assert_ok!(config, admin.get_config()); let config = Config::new(None, None, None, false); assert_ok!((), admin.write_config(config)); - let get_config = admin.get_config().unwrap(); - assert_eq!(config, get_config); + assert_ok!(config, admin.get_config()); } #[test_device] |