diff options
Diffstat (limited to 'tests/device.rs')
-rw-r--r-- | tests/device.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/device.rs b/tests/device.rs index f7d8df3..db8194c 100644 --- a/tests/device.rs +++ b/tests/device.rs @@ -31,6 +31,8 @@ fn count_nitrokey_block_devices() -> usize { #[test_device] fn connect_no_device() { assert!(nitrokey::connect().is_err()); + assert!(nitrokey::connect_model(nitrokey::Model::Pro).is_err()); + assert!(nitrokey::connect_model(nitrokey::Model::Storage).is_err()); assert!(nitrokey::Pro::connect().is_err()); assert!(nitrokey::Storage::connect().is_err()); } @@ -41,7 +43,11 @@ fn connect_pro(device: Pro) { drop(device); assert!(nitrokey::connect().is_ok()); + assert!(nitrokey::connect_model(nitrokey::Model::Pro).is_ok()); assert!(nitrokey::Pro::connect().is_ok()); + + assert!(nitrokey::connect_model(nitrokey::Model::Storage).is_err()); + assert!(nitrokey::Storage::connect().is_err()); } #[test_device] @@ -50,7 +56,11 @@ fn connect_storage(device: Storage) { drop(device); assert!(nitrokey::connect().is_ok()); + assert!(nitrokey::connect_model(nitrokey::Model::Storage).is_ok()); assert!(nitrokey::Storage::connect().is_ok()); + + assert!(nitrokey::connect_model(nitrokey::Model::Pro).is_err()); + assert!(nitrokey::Pro::connect().is_err()); } fn assert_empty_serial_number() { |