]> code.delx.au - gnu-emacs/blobdiff - test/automated/package-test.el
Merge from emacs-24
[gnu-emacs] / test / automated / package-test.el
index e7c989de57aa32e23c608d032f4dde8280175eae..a0c1359b13288ad67ad92e6ca274c824534a39f5 100644 (file)
@@ -89,6 +89,8 @@
   "Set up temporary locations and variables for testing."
   (declare (indent 1))
   `(let* ((package-test-user-dir (make-temp-file "pkg-test-user-dir-" t))
+          (process-environment (cons (format "HOME=%s" package-test-user-dir)
+                                     process-environment))
           (package-user-dir package-test-user-dir)
           (package-archives `(("gnu" . ,package-test-data-dir)))
           (old-yes-no-defn (symbol-function 'yes-or-no-p))
@@ -265,7 +267,7 @@ Must called from within a `tar-mode' buffer."
       (should (package-installed-p 'simple-single))
       (switch-to-buffer "*Packages*")
       (goto-char (point-min))
-      (should (re-search-forward "^\\s-+simple-single\\s-+1.3\\s-+unsigned" nil t))
+      (should (re-search-forward "^\\s-+simple-single\\s-+1.3\\s-+installed" nil t))
       (goto-char (point-min))
       (should-not (re-search-forward "^\\s-+simple-single\\s-+1.3\\s-+\\(available\\|new\\)" nil t))
       (kill-buffer buf))))
@@ -287,7 +289,7 @@ Must called from within a `tar-mode' buffer."
         ;; New version should be available and old version should be installed
         (goto-char (point-min))
         (should (re-search-forward "^\\s-+simple-single\\s-+1.4\\s-+new" nil t))
-        (should (re-search-forward "^\\s-+simple-single\\s-+1.3\\s-+unsigned" nil t))
+        (should (re-search-forward "^\\s-+simple-single\\s-+1.3\\s-+installed" nil t))
 
         (goto-char (point-min))
         (should (re-search-forward "^\\s-+new-pkg\\s-+1.0\\s-+\\(available\\|new\\)" nil t))
@@ -318,7 +320,7 @@ Must called from within a `tar-mode' buffer."
     (with-fake-help-buffer
      (describe-package 'simple-single)
      (goto-char (point-min))
-     (should (search-forward "simple-single is an unsigned package." nil t))
+     (should (search-forward "simple-single is an installed package." nil t))
      (should (search-forward
               (format "Status: Installed in `%s/' (unsigned)."
                       (expand-file-name "simple-single-1.3" package-user-dir))
@@ -361,11 +363,15 @@ Must called from within a `tar-mode' buffer."
 
 (ert-deftest package-test-signed ()
   "Test verifying package signature."
-  :expected-result (condition-case nil
-                      (progn
+  (skip-unless (ignore-errors
+                (let ((homedir (make-temp-file "package-test" t)))
+                  (unwind-protect
+                      (let ((process-environment
+                             (cons (format "HOME=%s" homedir)
+                                   process-environment)))
                         (epg-check-configuration (epg-configuration))
-                        :passed)
-                    (error :failed))
+                        t)
+                    (delete-directory homedir t)))))
   (let* ((keyring (expand-file-name "key.pub" package-test-data-dir))
         (package-test-data-dir
           (expand-file-name "data/package/signed" package-test-file-dir)))