summaryrefslogtreecommitdiff
path: root/test/lisp/net/secrets-tests.el
diff options
context:
space:
mode:
authorMichael Albinus <michael.albinus@gmx.de>2021-12-27 19:53:00 +0100
committerMichael Albinus <michael.albinus@gmx.de>2021-12-27 19:53:00 +0100
commit4ab5b89de84c8ae6254e11330b783a42e2c40121 (patch)
treedc8fc9c803066bd431f6d6a30db1ec541f284170 /test/lisp/net/secrets-tests.el
parent01df347947c8785c7c21d5a2baa12de2ffde80dd (diff)
downloademacs-4ab5b89de84c8ae6254e11330b783a42e2c40121.tar.gz
emacs-4ab5b89de84c8ae6254e11330b783a42e2c40121.tar.bz2
emacs-4ab5b89de84c8ae6254e11330b783a42e2c40121.zip
The temprary "session" collection might not exist in Secret Service
* doc/misc/auth.texi (Secret Service API): * test/lisp/net/secrets-tests.el (secrets--test-delete-all-session-items) (secrets-test02-collections, secrets-test03-items) (secrets-test04-search): The temporary "session" collection might not exist. * lisp/net/secrets.el (secrets-struct-secret-content-type): Remove compatibility hack. (secrets-create-item): Adapt accordingly.
Diffstat (limited to 'test/lisp/net/secrets-tests.el')
-rw-r--r--test/lisp/net/secrets-tests.el11
1 files changed, 8 insertions, 3 deletions
diff --git a/test/lisp/net/secrets-tests.el b/test/lisp/net/secrets-tests.el
index b392c4d1847..03d3e26faa6 100644
--- a/test/lisp/net/secrets-tests.el
+++ b/test/lisp/net/secrets-tests.el
@@ -57,8 +57,11 @@
(defun secrets--test-delete-all-session-items ()
"Delete all items of collection \"session\" bound to this Emacs."
- (dolist (item (secrets-list-items "session"))
- (secrets-delete-item "session" item)))
+ ;; If the "session" collection does not exist, a `dbus-error' is
+ ;; fired, which we ignore.
+ (dbus-ignore-errors
+ (dolist (item (secrets-list-items "session"))
+ (secrets-delete-item "session" item))))
(ert-deftest secrets-test01-sessions ()
"Test opening / closing a secrets session."
@@ -93,7 +96,7 @@
(unwind-protect
(progn
(should (secrets-open-session))
- (should (member "session" (secrets-list-collections)))
+ (skip-unless (member "session" (secrets-list-collections)))
;; Create a random collection. This asks for a password
;; outside our control, so we make it in the interactive case
@@ -153,6 +156,7 @@
(unwind-protect
(let (item-path)
(should (secrets-open-session))
+ (skip-unless (member "session" (secrets-list-collections)))
;; Cleanup. There could be items in the "session" collection.
(secrets--test-delete-all-session-items)
@@ -214,6 +218,7 @@
(unwind-protect
(progn
(should (secrets-open-session))
+ (skip-unless (member "session" (secrets-list-collections)))
;; Cleanup. There could be items in the "session" collection.
(secrets--test-delete-all-session-items)