aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/device.rs12
1 files changed, 8 insertions, 4 deletions
diff --git a/tests/device.rs b/tests/device.rs
index 5c52024..527d6f2 100644
--- a/tests/device.rs
+++ b/tests/device.rs
@@ -36,11 +36,15 @@ fn connect_no_device() {
assert_cmu_err!(CommunicationError::NotConnected, nitrokey::connect());
assert_cmu_err!(
CommunicationError::NotConnected,
- nitrokey::connect_model(nitrokey::Model::Pro)
+ nitrokey::take()
+ .unwrap()
+ .connect_model(nitrokey::Model::Pro)
);
assert_cmu_err!(
CommunicationError::NotConnected,
- nitrokey::connect_model(nitrokey::Model::Storage)
+ nitrokey::take()
+ .unwrap()
+ .connect_model(nitrokey::Model::Storage)
);
assert_cmu_err!(CommunicationError::NotConnected, nitrokey::Pro::connect());
assert_cmu_err!(
@@ -55,7 +59,7 @@ fn connect_pro(device: Pro) {
drop(device);
assert_any_ok!(nitrokey::connect());
- assert_any_ok!(nitrokey::connect_model(nitrokey::Model::Pro));
+ assert_any_ok!(nitrokey::take().unwrap().connect_model(nitrokey::Model::Pro));
assert_any_ok!(nitrokey::Pro::connect());
}
@@ -65,7 +69,7 @@ fn connect_storage(device: Storage) {
drop(device);
assert_any_ok!(nitrokey::connect());
- assert_any_ok!(nitrokey::connect_model(nitrokey::Model::Storage));
+ assert_any_ok!(nitrokey::take().unwrap().connect_model(nitrokey::Model::Storage));
assert_any_ok!(nitrokey::Storage::connect());
}