aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorMichael Albinus2021-12-27 19:53:00 +0100
committerMichael Albinus2021-12-27 19:53:00 +0100
commit4ab5b89de84c8ae6254e11330b783a42e2c40121 (patch)
treedc8fc9c803066bd431f6d6a30db1ec541f284170 /test
parent01df347947c8785c7c21d5a2baa12de2ffde80dd (diff)
downloademacs-4ab5b89de84c8ae6254e11330b783a42e2c40121.tar.gz
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')
-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 @@
57 57
58(defun secrets--test-delete-all-session-items () 58(defun secrets--test-delete-all-session-items ()
59 "Delete all items of collection \"session\" bound to this Emacs." 59 "Delete all items of collection \"session\" bound to this Emacs."
60 (dolist (item (secrets-list-items "session")) 60 ;; If the "session" collection does not exist, a `dbus-error' is
61 (secrets-delete-item "session" item))) 61 ;; fired, which we ignore.
62 (dbus-ignore-errors
63 (dolist (item (secrets-list-items "session"))
64 (secrets-delete-item "session" item))))
62 65
63(ert-deftest secrets-test01-sessions () 66(ert-deftest secrets-test01-sessions ()
64 "Test opening / closing a secrets session." 67 "Test opening / closing a secrets session."
@@ -93,7 +96,7 @@
93 (unwind-protect 96 (unwind-protect
94 (progn 97 (progn
95 (should (secrets-open-session)) 98 (should (secrets-open-session))
96 (should (member "session" (secrets-list-collections))) 99 (skip-unless (member "session" (secrets-list-collections)))
97 100
98 ;; Create a random collection. This asks for a password 101 ;; Create a random collection. This asks for a password
99 ;; outside our control, so we make it in the interactive case 102 ;; outside our control, so we make it in the interactive case
@@ -153,6 +156,7 @@
153 (unwind-protect 156 (unwind-protect
154 (let (item-path) 157 (let (item-path)
155 (should (secrets-open-session)) 158 (should (secrets-open-session))
159 (skip-unless (member "session" (secrets-list-collections)))
156 160
157 ;; Cleanup. There could be items in the "session" collection. 161 ;; Cleanup. There could be items in the "session" collection.
158 (secrets--test-delete-all-session-items) 162 (secrets--test-delete-all-session-items)
@@ -214,6 +218,7 @@
214 (unwind-protect 218 (unwind-protect
215 (progn 219 (progn
216 (should (secrets-open-session)) 220 (should (secrets-open-session))
221 (skip-unless (member "session" (secrets-list-collections)))
217 222
218 ;; Cleanup. There could be items in the "session" collection. 223 ;; Cleanup. There could be items in the "session" collection.
219 (secrets--test-delete-all-session-items) 224 (secrets--test-delete-all-session-items)