aboutsummaryrefslogtreecommitdiff
path: root/tests/device.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/device.rs')
-rw-r--r--tests/device.rs17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/device.rs b/tests/device.rs
index 2c8cfa6..a6098b7 100644
--- a/tests/device.rs
+++ b/tests/device.rs
@@ -81,6 +81,23 @@ fn disconnect() {
assert_empty_serial_number();
}
+fn require_model(model: nitrokey::Model) {
+ assert_eq!(model, nitrokey::connect().unwrap().get_model());
+ assert_eq!(model, Target::connect().unwrap().get_model());
+}
+
+#[test]
+#[cfg_attr(not(feature = "test-pro"), ignore)]
+fn get_model_pro() {
+ require_model(nitrokey::Model::Pro);
+}
+
+#[test]
+#[cfg_attr(not(feature = "test-storage"), ignore)]
+fn get_model_storage() {
+ require_model(nitrokey::Model::Storage);
+}
+
#[test]
#[cfg_attr(not(any(feature = "test-pro", feature = "test-storage")), ignore)]
fn get_serial_number() {