]> git.eshelyaron.com Git - emacs.git/commitdiff
* test/lisp/emacs-lisp/package-tests.el: Improve signature tests
authorStefan Monnier <monnier@iro.umontreal.ca>
Thu, 22 Feb 2018 21:59:30 +0000 (16:59 -0500)
committerStefan Monnier <monnier@iro.umontreal.ca>
Thu, 22 Feb 2018 22:00:00 +0000 (17:00 -0500)
(package-test-signed): Don't rely on return value of 'package-install'.
Make sure 'package-install' does indeed install the package.

test/lisp/emacs-lisp/package-tests.el

index 62fba58919f4dc2ce0a78c3b7a7f202fcec1c12f..83f52284889ac59d108864dcd810b4dca825736b 100644 (file)
@@ -484,14 +484,16 @@ Must called from within a `tar-mode' buffer."
       (package-import-keyring keyring)
       (package-refresh-contents)
       (let ((package-check-signature 'allow-unsigned))
-        (should (package-install 'signed-good))
+        (should (progn (package-install 'signed-good) 'noerror))
         (should-error (package-install 'signed-bad)))
+      (package-delete (car (alist-get 'signed-good package-alist)))
       (let ((package-check-signature t))
-        (should (package-install 'signed-good))
+        (should (progn (package-install 'signed-good) 'noerror))
         (should-error (package-install 'signed-bad)))
+      (package-delete (car (alist-get 'signed-good package-alist)))
       (let ((package-check-signature nil))
-        (should (package-install 'signed-good))
-        (should (package-install 'signed-bad)))
+        (should (progn (package-install 'signed-good) 'noerror))
+        (should (progn (package-install 'signed-bad) 'noerror)))
       ;; Check if the installed package status is updated.
       (let ((buf (package-list-packages)))
        (package-menu-refresh)