diff options
| author | Michael Albinus | 2025-09-12 12:29:30 +0200 |
|---|---|---|
| committer | Michael Albinus | 2025-09-12 12:29:30 +0200 |
| commit | 26ad23addbf79862f310136d2f0d95568fef3a04 (patch) | |
| tree | 883d26b6ee0f0292a6b1f26ef22c950edf4ceaed /test | |
| parent | 43f507f4308a9c4b3bdcb1ef7614e29914c76561 (diff) | |
| download | emacs-26ad23addbf79862f310136d2f0d95568fef3a04.tar.gz emacs-26ad23addbf79862f310136d2f0d95568fef3a04.zip | |
Introduc auth-source-ignore-non-existing-file
* lisp/auth-source.el (auth-source-ignore-non-existing-file):
Rename it from `auth-source-ignore-empty-file'.
(auth-source-backends-parser-file): Use it.
* doc/misc/auth.texi (Help for users):
* etc/NEWS:
* test/lisp/auth-source-tests.el (auth-source-validate-backend)
(auth-source-test-netrc-create-secret):
Use `auth-source-ignore-non-existing-file'.
Diffstat (limited to 'test')
| -rw-r--r-- | test/lisp/auth-source-tests.el | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/test/lisp/auth-source-tests.el b/test/lisp/auth-source-tests.el index 7ae337650f9..b4bc0f5a7f6 100644 --- a/test/lisp/auth-source-tests.el +++ b/test/lisp/auth-source-tests.el | |||
| @@ -37,7 +37,7 @@ | |||
| 37 | (type . ignore)))) | 37 | (type . ignore)))) |
| 38 | 38 | ||
| 39 | (defun auth-source-validate-backend (source validation-alist) | 39 | (defun auth-source-validate-backend (source validation-alist) |
| 40 | (let* (auth-source-ignore-empty-file | 40 | (let* (auth-source-ignore-non-existing-file |
| 41 | (backend (auth-source-backend-parse source))) | 41 | (backend (auth-source-backend-parse source))) |
| 42 | (should (auth-source-backend-p backend)) | 42 | (should (auth-source-backend-p backend)) |
| 43 | (dolist (pair validation-alist) | 43 | (dolist (pair validation-alist) |
| @@ -375,13 +375,13 @@ | |||
| 375 | "%s@%s" (plist-get auth-info :user) (plist-get auth-info :host))))))) | 375 | "%s@%s" (plist-get auth-info :user) (plist-get auth-info :host))))))) |
| 376 | 376 | ||
| 377 | (ert-deftest auth-source-test-netrc-create-secret () | 377 | (ert-deftest auth-source-test-netrc-create-secret () |
| 378 | (ert-with-temp-file empty-file :suffix "auth-source-test" | ||
| 379 | (ert-with-temp-file netrc-file | 378 | (ert-with-temp-file netrc-file |
| 380 | :suffix "auth-source-test" | 379 | :suffix "auth-source-test" |
| 381 | :text "machine a1 port a2 user a3 password a4" | 380 | :text "machine a1 port a2 user a3 password a4" |
| 382 | (let* ((auth-sources (list empty-file netrc-file)) | 381 | (let* ((non-existing-file (make-temp-name temporary-file-directory)) |
| 382 | (auth-sources (list non-existing-file netrc-file)) | ||
| 383 | (auth-source-save-behavior t) | 383 | (auth-source-save-behavior t) |
| 384 | (auth-source-ignore-empty-file t) | 384 | (auth-source-ignore-non-existing-file t) |
| 385 | host auth-info auth-passwd) | 385 | host auth-info auth-passwd) |
| 386 | (dolist (passwd '("foo" "" nil)) | 386 | (dolist (passwd '("foo" "" nil)) |
| 387 | ;; Redefine `read-*' in order to avoid interactive input. | 387 | ;; Redefine `read-*' in order to avoid interactive input. |
| @@ -419,7 +419,7 @@ | |||
| 419 | (string-equal (plist-get auth-info :user) (user-login-name))) | 419 | (string-equal (plist-get auth-info :user) (user-login-name))) |
| 420 | (should (string-equal (plist-get auth-info :host) host)) | 420 | (should (string-equal (plist-get auth-info :host) host)) |
| 421 | (should (string-equal auth-passwd passwd)) | 421 | (should (string-equal auth-passwd passwd)) |
| 422 | (should (search-forward host nil 'noerror)))))))))) | 422 | (should (search-forward host nil 'noerror))))))))) |
| 423 | 423 | ||
| 424 | (ert-deftest auth-source-delete () | 424 | (ert-deftest auth-source-delete () |
| 425 | (ert-with-temp-file netrc-file | 425 | (ert-with-temp-file netrc-file |