diff options
author | H Durer <h.duerer@gmail.com> | 2018-03-02 20:25:15 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-03-02 20:25:15 +0000 |
commit | ca4bb2a436f1ba46515b812c97d74333294bae76 (patch) | |
tree | da489813900e660e5d9460ed1a9c9b13869d344a /test/mastodon-auth-tests.el | |
parent | 3e9bdbf2eeecafd7bb0673f2709f816a740c7d61 (diff) | |
parent | b1f05c07c8f00e4546b1ff07be47537660a0b5f6 (diff) |
Merge pull request #154 from hdurer/multi-instance-in-plstore
Keep track of to which instance secrets in plstore belong
Diffstat (limited to 'test/mastodon-auth-tests.el')
-rw-r--r-- | test/mastodon-auth-tests.el | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/test/mastodon-auth-tests.el b/test/mastodon-auth-tests.el index 70c63d8..719a56c 100644 --- a/test/mastodon-auth-tests.el +++ b/test/mastodon-auth-tests.el @@ -14,7 +14,8 @@ ("username" . "foo@bar.com") ("password" . "password") ("scope" . "read write follow")) - nil)) + nil + :unauthenticated)) (mastodon-auth--generate-token)))) (ert-deftest get-token () @@ -26,15 +27,17 @@ (current-buffer))) (should (equal (mastodon-auth--get-token) '(:access_token "abcdefg")))))) -(ert-deftest access-token-1 () - "Should return `mastodon-auth--token' if non-nil." - (let ((mastodon-auth--token "foobar")) +(ert-deftest access-token-found () + "Should return value in `mastodon-auth--token-alist' if found." + (let ((mastodon-instance-url "https://instance.url") + (mastodon-auth--token-alist '(("https://instance.url" . "foobar")) )) (should (string= (mastodon-auth--access-token) "foobar")))) (ert-deftest access-token-2 () "Should set and return `mastodon-auth--token' if nil." - (let ((mastodon-auth--token nil)) + (let ((mastodon-instance-url "https://instance.url") + (mastodon-auth--token nil)) (with-mock (mock (mastodon-auth--get-token) => '(:access_token "foobaz")) (should (string= (mastodon-auth--access-token) "foobaz")) - (should (string= mastodon-auth--token "foobaz"))))) + (should (equal mastodon-auth--token-alist '(("https://instance.url" . "foobaz"))))))) |