diff options
| author | foudfou | 2017-02-16 09:34:17 +0100 |
|---|---|---|
| committer | Ted Zlatanov | 2017-04-27 17:37:58 -0400 |
| commit | b206b95ce3c598a5f3c62cfe83030da14952c81d (patch) | |
| tree | 3e5f55f6ac25ab78d9a270241ae5cace3638a07a /test | |
| parent | 0e066efe3b84ee9ecfc0a075e0ce289311f6d160 (diff) | |
| download | emacs-b206b95ce3c598a5f3c62cfe83030da14952c81d.tar.gz emacs-b206b95ce3c598a5f3c62cfe83030da14952c81d.zip | |
auth-source-pass: Enable finding entries by "host/username"
* lisp/auth-source-pass.el: Enable finding entries by "host/username".
* test/lisp/auth-source-pass-tests.el: Adjust tests to check it.
Diffstat (limited to 'test')
| -rw-r--r-- | test/lisp/auth-source-pass-tests.el | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/test/lisp/auth-source-pass-tests.el b/test/lisp/auth-source-pass-tests.el index c3586d8058c..1a7c9a70365 100644 --- a/test/lisp/auth-source-pass-tests.el +++ b/test/lisp/auth-source-pass-tests.el | |||
| @@ -210,14 +210,18 @@ ease testing." | |||
| 210 | 210 | ||
| 211 | (ert-deftest auth-source-pass-only-return-entries-that-can-be-open () | 211 | (ert-deftest auth-source-pass-only-return-entries-that-can-be-open () |
| 212 | (cl-letf (((symbol-function 'auth-source-pass-entries) | 212 | (cl-letf (((symbol-function 'auth-source-pass-entries) |
| 213 | (lambda () '("foo.site.com" "bar.site.com"))) | 213 | (lambda () '("foo.site.com" "bar.site.com" |
| 214 | "mail/baz.site.com/scott"))) | ||
| 214 | ((symbol-function 'auth-source-pass--entry-valid-p) | 215 | ((symbol-function 'auth-source-pass--entry-valid-p) |
| 215 | ;; only foo.site.com is valid | 216 | ;; only foo.site.com and "mail/baz.site.com/scott" are valid |
| 216 | (lambda (entry) (string-equal entry "foo.site.com")))) | 217 | (lambda (entry) (member entry '("foo.site.com" |
| 217 | (should (equal (auth-source-pass--find-all-by-entry-name "foo.site.com") | 218 | "mail/baz.site.com/scott"))))) |
| 219 | (should (equal (auth-source-pass--find-all-by-entry-name "foo.site.com" "someuser") | ||
| 218 | '("foo.site.com"))) | 220 | '("foo.site.com"))) |
| 219 | (should (equal (auth-source-pass--find-all-by-entry-name "bar.site.com") | 221 | (should (equal (auth-source-pass--find-all-by-entry-name "bar.site.com" "someuser") |
| 220 | '())))) | 222 | '())) |
| 223 | (should (equal (auth-pass--find-all-by-entry-name "baz.site.com" "scott") | ||
| 224 | '("mail/baz.site.com/scott"))))) | ||
| 221 | 225 | ||
| 222 | (ert-deftest auth-source-pass-entry-is-not-valid-when-unreadable () | 226 | (ert-deftest auth-source-pass-entry-is-not-valid-when-unreadable () |
| 223 | (cl-letf (((symbol-function 'auth-source-pass--read-entry) | 227 | (cl-letf (((symbol-function 'auth-source-pass--read-entry) |