From 2cc711a12307b2f61d42233d0d3619ccd8f434ea Mon Sep 17 00:00:00 2001 From: Abhiseck Paira Date: Wed, 26 Jan 2022 21:18:21 +0530 Subject: test: change mastodon files loading order Before tests start test/ert-helper.el file is loaded which in turn loads other lisp/* files so that required functions and variables are defined during tests. Load lisp/mastodon.el file first before loading other files this solves the complain during tests that `mastodon-active-user' is not defined. --- test/ert-helper.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test') diff --git a/test/ert-helper.el b/test/ert-helper.el index a6d6692..fc4da2d 100644 --- a/test/ert-helper.el +++ b/test/ert-helper.el @@ -1,3 +1,4 @@ +(load-file "lisp/mastodon.el") (load-file "lisp/mastodon-search.el") (load-file "lisp/mastodon-async.el") (load-file "lisp/mastodon-http.el") @@ -11,4 +12,3 @@ (load-file "lisp/mastodon-search.el") (load-file "lisp/mastodon-tl.el") (load-file "lisp/mastodon-toot.el") -(load-file "lisp/mastodon.el") -- cgit v1.2.3 From 6ff4416b809b7e8f2e7aab4e701633234dee8c1a Mon Sep 17 00:00:00 2001 From: Abhiseck Paira Date: Wed, 26 Jan 2022 21:05:51 +0530 Subject: test: update client website in mastodon-client--register The test `mastodon-client--register' specifies that the `mastodon-http--post' be called with a specific value. The value it specified is outdated since mastodon.el's current website has changed. So update the value with URL of the current website. --- test/mastodon-client-tests.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test') diff --git a/test/mastodon-client-tests.el b/test/mastodon-client-tests.el index 9123286..3f6cc29 100644 --- a/test/mastodon-client-tests.el +++ b/test/mastodon-client-tests.el @@ -10,7 +10,7 @@ '(("client_name" . "mastodon.el") ("redirect_uris" . "urn:ietf:wg:oauth:2.0:oob") ("scopes" . "read write follow") - ("website" . "https://github.com/jdenen/mastodon.el")) + ("website" . "https://codeberg.org/martianh/mastodon.el")) nil :unauthenticated)) (mastodon-client--register))) -- cgit v1.2.3 From 5071c96ad8b5af942eef5bf6c92d57929eb63188 Mon Sep 17 00:00:00 2001 From: Abhiseck Paira Date: Wed, 26 Jan 2022 21:14:05 +0530 Subject: test: remove tests for non existent functions Remove the tests `mastodon-auth--generate-token--no-storing-credentials' and `mastodon-auth--generate-token--storing-credentials' as functions with similar names no longer exist (due to implementation of the new login mechanism) --- test/mastodon-auth-tests.el | 41 ----------------------------------------- 1 file changed, 41 deletions(-) (limited to 'test') diff --git a/test/mastodon-auth-tests.el b/test/mastodon-auth-tests.el index 6a090b7..5039bef 100644 --- a/test/mastodon-auth-tests.el +++ b/test/mastodon-auth-tests.el @@ -32,47 +32,6 @@ `(:error "invalid_grant" :error_description ,error-message)) (t error)))))) -(ert-deftest mastodon-auth--generate-token--no-storing-credentials () - "Should make `mastdon-http--post' request to generate auth token." - (with-mock - (let ((mastodon-auth-source-file "") - (mastodon-instance-url "https://instance.url")) - (mock (mastodon-client) => '(:client_id "id" :client_secret "secret")) - (mock (read-string "Email: " user-mail-address) => "foo@bar.com") - (mock (read-passwd "Password: ") => "password") - (mock (mastodon-http--post "https://instance.url/oauth/token" - '(("client_id" . "id") - ("client_secret" . "secret") - ("grant_type" . "password") - ("username" . "foo@bar.com") - ("password" . "password") - ("scope" . "read write follow")) - nil - :unauthenticated)) - (mastodon-auth--generate-token)))) - -(ert-deftest mastodon-auth--generate-token--storing-credentials () - "Should make `mastdon-http--post' request to generate auth token." - (with-mock - (let ((mastodon-auth-source-file "~/.authinfo") - (mastodon-instance-url "https://instance.url")) - (mock (mastodon-client) => '(:client_id "id" :client_secret "secret")) - (mock (auth-source-search :create t - :host "https://instance.url" - :port 443 - :require '(:user :secret)) - => '((:user "foo@bar.com" :secret (lambda () "password")))) - (mock (mastodon-http--post "https://instance.url/oauth/token" - '(("client_id" . "id") - ("client_secret" . "secret") - ("grant_type" . "password") - ("username" . "foo@bar.com") - ("password" . "password") - ("scope" . "read write follow")) - nil - :unauthenticated)) - (mastodon-auth--generate-token)))) - (ert-deftest mastodon-auth--get-token () "Should generate token and return JSON response." (with-temp-buffer -- cgit v1.2.3 From 7f6102b2ac7ba8b520b3ae53717dd064e0eebee8 Mon Sep 17 00:00:00 2001 From: Abhiseck Paira Date: Thu, 27 Jan 2022 20:14:23 +0530 Subject: test: fix mastodon-auth--access-token-not-found Since the function `mastodon-auth--handle-token-response' now calls `mastodon-client-store-access-token' and `mastodon-client-make-user-active', define mock and stub for them respectively. --- test/mastodon-auth-tests.el | 2 ++ 1 file changed, 2 insertions(+) (limited to 'test') diff --git a/test/mastodon-auth-tests.el b/test/mastodon-auth-tests.el index 5039bef..3ff745f 100644 --- a/test/mastodon-auth-tests.el +++ b/test/mastodon-auth-tests.el @@ -56,6 +56,8 @@ (mastodon-auth--token-alist nil)) (with-mock (mock (mastodon-auth--get-token) => '(:access_token "foobaz")) + (mock (mastodon-client-store-access-token "foobaz")) + (stub mastodon-client-make-user-active) (should (string= (mastodon-auth--access-token) "foobaz")) -- cgit v1.2.3 From ca740c747ae23370c2850b5df6262e366375d7e4 Mon Sep 17 00:00:00 2001 From: Abhiseck Paira Date: Fri, 11 Feb 2022 00:48:00 +0530 Subject: test: merge mastodon-client--store1 and *store2 Merge `mastodon-client--store1' and `mastodon-client--store2' into a single test `mastodon-client--store' that test the function with the same name. --- test/mastodon-client-tests.el | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) (limited to 'test') diff --git a/test/mastodon-client-tests.el b/test/mastodon-client-tests.el index 3f6cc29..6291d02 100644 --- a/test/mastodon-client-tests.el +++ b/test/mastodon-client-tests.el @@ -24,25 +24,22 @@ (current-buffer))) (should (equal (mastodon-client--fetch) '(:foo "bar")))))) -(ert-deftest mastodon-client--store-1 () - "Should return the client plist." +(ert-deftest mastodon-client--store () + "Test the value `mastodon-client--store' returns/stores." (let ((mastodon-instance-url "http://mastodon.example") (plist '(:client_id "id" :client_secret "secret"))) (with-mock (mock (mastodon-client--token-file) => "stubfile.plstore") - (mock (mastodon-client--fetch) => '(:client_id "id" :client_secret "secret")) - (let* ((plstore (plstore-open "stubfile.plstore")) - (client (cdr (plstore-get plstore "mastodon-http://mastodon.example")))) - (should (equal (mastodon-client--store) plist)))))) + (mock (mastodon-client--fetch) => plist) + (should (equal (mastodon-client--store) plist))) + (let* ((plstore (plstore-open "stubfile.plstore")) + (client (mastodon-client--remove-key-from-plstore + (plstore-get plstore "mastodon-http://mastodon.example")))) + (plstore-close plstore) + (should (equal client plist)) + ;; clean up - delete the stubfile + (delete-file "stubfile.plstore")))) -(ert-deftest mastodon-client--store-2 () - "Should store client in `mastodon-client--token-file'." - (let* ((mastodon-instance-url "http://mastodon.example") - (plstore (plstore-open "stubfile.plstore")) - (client (cdr (plstore-get plstore "mastodon-http://mastodon.example")))) - (plstore-close plstore) - (should (string= (plist-get client :client_id) "id")) - (should (string= (plist-get client :client_secret) "secret")))) (ert-deftest mastodon-client--read-finds-match () "Should return mastodon client from `mastodon-token-file' if it exists." -- cgit v1.2.3 From f1ef6f7c8accc7ce3fd44373776727afe3d8957c Mon Sep 17 00:00:00 2001 From: Abhiseck Paira Date: Wed, 16 Feb 2022 21:57:04 +0530 Subject: test: add test for mastodon-client--general-read --- test/mastodon-client-tests.el | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'test') diff --git a/test/mastodon-client-tests.el b/test/mastodon-client-tests.el index 6291d02..3c667b1 100644 --- a/test/mastodon-client-tests.el +++ b/test/mastodon-client-tests.el @@ -49,6 +49,27 @@ (should (equal (mastodon-client--read) '(:client_id "id2" :client_secret "secret2")))))) +(ert-deftest mastodon-client--general-read-finds-match () + (with-mock + (mock (mastodon-client--token-file) => "fixture/client.plstore") + (should (equal (mastodon-client--general-read "user-test8000@mastodon.example") + '(:username "test8000@mastodon.example" + :instance "http://mastodon.example" + :client_id "id2" :client_secret "secret2" + :access_token "token2"))))) + +(ert-deftest mastodon-client--general-read-finds-no-match () + (with-mock + (mock (mastodon-client--token-file) => "fixture/client.plstore") + (should (equal (mastodon-client--general-read "nonexistant-key") + nil)))) + +(ert-deftest mastodon-client--general-read-empty-store () + (with-mock + (mock (mastodon-client--token-file) => "fixture/empty.plstore") + (should (equal (mastodon-client--general-read "something") + nil)))) + (ert-deftest mastodon-client--read-finds-no-match () "Should return mastodon client from `mastodon-token-file' if it exists." (let ((mastodon-instance-url "http://mastodon.social")) -- cgit v1.2.3 From 77c173afc1f24fa371c41d0c59b94a8650eb4f61 Mon Sep 17 00:00:00 2001 From: Abhiseck Paira Date: Wed, 16 Feb 2022 21:59:15 +0530 Subject: test: add more test Add the following tests: * mastodon-client--current-user-active-p * mastodon-client-store-access-token * mastodon-client-make-user-active * mastodon-client-form-user-from-vars --- test/mastodon-client-tests.el | 51 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) (limited to 'test') diff --git a/test/mastodon-client-tests.el b/test/mastodon-client-tests.el index 3c667b1..c2ec50c 100644 --- a/test/mastodon-client-tests.el +++ b/test/mastodon-client-tests.el @@ -121,3 +121,54 @@ (should (equal (mastodon-client) '(:client_id "foo" :client_secret "baz"))) (should (equal mastodon-client--client-details-alist '(("http://mastodon.example" :client_id "foo" :client_secret "baz"))))))) + +(ert-deftest mastodon-client-form-user-from-vars () + (let ((mastodon-active-user "test9000") + (mastodon-instance-url "https://mastodon.example")) + (should + (equal (mastodon-client-form-user-from-vars) + "test9000@mastodon.example")))) + +(ert-deftest mastodon-client--current-user-active-p () + (let ((mastodon-active-user "test9000") + (mastodon-instance-url "https://mastodon.example")) + ;; when the current user /is/ the active user + (with-mock + (mock (mastodon-client--general-read "active-user") => '(:username "test9000@mastodon.example" :client_id "id1")) + (should (equal (mastodon-client--current-user-active-p) + '(:username "test9000@mastodon.example" :client_id "id1")))) + ;; when the current user is /not/ the active user + (with-mock + (mock (mastodon-client--general-read "active-user") => '(:username "user@other.example" :client_id "id1")) + (should (null (mastodon-client--current-user-active-p)))))) + +(ert-deftest mastodon-client-store-access-token () + (let ((mastodon-instance-url "https://mastodon.example") + (mastodon-active-user "test8000") + (user-details + '(:username "test8000@mastodon.example" + :instance "https://mastodon.example" + :client_id "id" :client_secret "secret" + :access_token "token"))) + ;; test if mastodon-client-store-access-token /returns/ right + ;; value + (with-mock + (mock (mastodon-client) => '(:client_id "id" :client_secret "secret")) + (mock (mastodon-client--token-file) => "stubfile.plstore") + (should (equal (mastodon-client-store-access-token "token") + user-details))) + ;; test if mastodon-client-store-access-token /stores/ right value + (with-mock + (mock (mastodon-client--token-file) => "stubfile.plstore") + (should (equal (mastodon-client--general-read + "user-test8000@mastodon.example") + user-details))) + (delete-file "stubfile.plstore"))) + +(ert-deftest mastodon-client-make-user-active () + (let ((user-details '(:username "test@mastodon.example"))) + (with-mock + (mock (mastodon-client--token-file) => "stubfile.plstore") + (mastodon-client-make-user-active user-details) + (should (equal (mastodon-client--general-read "active-user") + user-details))))) -- cgit v1.2.3 From 9384324d0848a06bea40d894350c0d224dd6388e Mon Sep 17 00:00:00 2001 From: mousebot Date: Wed, 16 Feb 2022 10:49:45 +0100 Subject: ert-helper: load mastodon.el before -profile so mastodon-mode-map is avail --- test/ert-helper.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test') diff --git a/test/ert-helper.el b/test/ert-helper.el index a6d6692..c2fd5a6 100644 --- a/test/ert-helper.el +++ b/test/ert-helper.el @@ -7,8 +7,8 @@ (load-file "lisp/mastodon-inspect.el") (load-file "lisp/mastodon-media.el") (load-file "lisp/mastodon-notifications.el") +(load-file "lisp/mastodon.el") (load-file "lisp/mastodon-profile.el") (load-file "lisp/mastodon-search.el") (load-file "lisp/mastodon-tl.el") (load-file "lisp/mastodon-toot.el") -(load-file "lisp/mastodon.el") -- cgit v1.2.3 From 0af5b491d14d521c03ebc48d82608afd65166e90 Mon Sep 17 00:00:00 2001 From: Abhiseck Paira Date: Wed, 23 Feb 2022 14:24:37 +0530 Subject: change '-' to '--' in between function and namespace names mastodon.el currently follows the convention where all function names should have two dashes (not one dash) in between function and namespace names. Update all function names to follow this convention. See issue #205 and pull request #255 --- lisp/mastodon-auth.el | 20 ++++++++++---------- lisp/mastodon-client.el | 16 ++++++++-------- lisp/mastodon-http.el | 2 +- test/mastodon-auth-tests.el | 4 ++-- test/mastodon-client-tests.el | 16 ++++++++-------- 5 files changed, 29 insertions(+), 29 deletions(-) (limited to 'test') diff --git a/lisp/mastodon-auth.el b/lisp/mastodon-auth.el index c09dfdf..2540598 100644 --- a/lisp/mastodon-auth.el +++ b/lisp/mastodon-auth.el @@ -40,11 +40,11 @@ (autoload 'mastodon-http--api "mastodon-http") (autoload 'mastodon-http--get-json "mastodon-http") (autoload 'mastodon-http--post "mastodon-http") -(autoload 'mastodon-http-append-query-string "mastodon-http") -(autoload 'mastodon-client-store-access-token "mastodon-client") -(autoload 'mastodon-client-active-user "mastodon-client") -(autoload 'mastodon-client-make-user-active "mastodon-client") -(autoload 'mastodon-client-form-user-from-vars "mastodon-client") +(autoload 'mastodon-http--append-query-string "mastodon-http") +(autoload 'mastodon-client--store-access-token "mastodon-client") +(autoload 'mastodon-client--active-user "mastodon-client") +(autoload 'mastodon-client--make-user-active "mastodon-client") +(autoload 'mastodon-client--form-user-from-vars "mastodon-client") (defvar mastodon-instance-url) (defvar mastodon-client-scopes) (defvar mastodon-client-redirect-uri) @@ -71,7 +71,7 @@ if you are happy with unencryped storage use e.g. \"~/authinfo\"." (defun mastodon-auth--get-browser-login-url () "Return properly formed browser login url." - (mastodon-http-append-query-string + (mastodon-http--append-query-string (concat mastodon-instance-url "/oauth/authorize/") `(("response_type" "code") ("redirect_uri" ,mastodon-client-redirect-uri) @@ -127,11 +127,11 @@ Generate/save token if none known yet." ;; initialised already. (alist-get mastodon-instance-url mastodon-auth--token-alist nil nil 'equal)) - ((plist-get (mastodon-client-active-user) :access_token) + ((plist-get (mastodon-client--active-user) :access_token) ;; user variables needs to initialised by reading from ;; plstore. (push (cons mastodon-instance-url - (plist-get (mastodon-client-active-user) :access_token)) + (plist-get (mastodon-client--active-user) :access_token)) mastodon-auth--token-alist) (alist-get mastodon-instance-url mastodon-auth--token-alist nil nil 'equal)) @@ -149,8 +149,8 @@ Handle any errors from the server." (pcase response ((and (let token (plist-get response :access_token)) (guard token)) - (mastodon-client-make-user-active - (mastodon-client-store-access-token token)) + (mastodon-client--make-user-active + (mastodon-client--store-access-token token)) (cdar (push (cons mastodon-instance-url token) mastodon-auth--token-alist))) diff --git a/lisp/mastodon-client.el b/lisp/mastodon-client.el index c577fec..80338b1 100644 --- a/lisp/mastodon-client.el +++ b/lisp/mastodon-client.el @@ -124,12 +124,12 @@ Return plist without the KEY." (defun mastodon-client--make-user-details-plist () "Make a plist with current user details. Return it." - `(:username ,(mastodon-client-form-user-from-vars) + `(:username ,(mastodon-client--form-user-from-vars) :instance ,mastodon-instance-url :client_id ,(plist-get (mastodon-client) :client_id) :client_secret ,(plist-get (mastodon-client) :client_secret))) -(defun mastodon-client-store-access-token (token) +(defun mastodon-client--store-access-token (token) "Save TOKEN as :access_token in plstore of the current user. Return the plist after the operation." (let* ((user-details (mastodon-client--make-user-details-plist)) @@ -144,7 +144,7 @@ Return the plist after the operation." (plstore-close plstore) plstore-value)) -(defun mastodon-client-make-user-active (user-details) +(defun mastodon-client--make-user-active (user-details) "USER-DETAILS is a plist consisting of user details." (let ((plstore (plstore-open (mastodon-client--token-file))) (print-length nil) @@ -153,7 +153,7 @@ Return the plist after the operation." (plstore-save plstore) (plstore-close plstore))) -(defun mastodon-client-form-user-from-vars () +(defun mastodon-client--form-user-from-vars () "Create a username from user variable. Return that username. Username in the form user@instance.com is formed from the @@ -165,23 +165,23 @@ variables `mastodon-instance-url' and `mastodon-active-user'." (defun mastodon-client--make-current-user-active () "Make the user specified by user variables active user. Return the details (plist)." - (let ((username (mastodon-client-form-user-from-vars)) + (let ((username (mastodon-client--form-user-from-vars)) user-plist) (when (setq user-plist (mastodon-client--general-read (concat "user-" username))) - (mastodon-client-make-user-active user-plist)) + (mastodon-client--make-user-active user-plist)) user-plist)) (defun mastodon-client--current-user-active-p () "Return user-details if the current user is active. Otherwise return nil." - (let ((username (mastodon-client-form-user-from-vars)) + (let ((username (mastodon-client--form-user-from-vars)) (user-details (mastodon-client--general-read "active-user"))) (when (and user-details (equal (plist-get user-details :username) username)) user-details))) -(defun mastodon-client-active-user () +(defun mastodon-client--active-user () "Return the details of the currently active user. Details is a plist." diff --git a/lisp/mastodon-http.el b/lisp/mastodon-http.el index 8e96b39..05c9d2e 100644 --- a/lisp/mastodon-http.el +++ b/lisp/mastodon-http.el @@ -157,7 +157,7 @@ Pass response buffer to CALLBACK function." (with-temp-buffer (mastodon-http--url-retrieve-synchronously url)))) -(defun mastodon-http-append-query-string (url params) +(defun mastodon-http--append-query-string (url params) "Append PARAMS to URL as query strings and return it. PARAMS should be an alist as required `url-build-query-string'." diff --git a/test/mastodon-auth-tests.el b/test/mastodon-auth-tests.el index 3ff745f..3bf65b2 100644 --- a/test/mastodon-auth-tests.el +++ b/test/mastodon-auth-tests.el @@ -56,8 +56,8 @@ (mastodon-auth--token-alist nil)) (with-mock (mock (mastodon-auth--get-token) => '(:access_token "foobaz")) - (mock (mastodon-client-store-access-token "foobaz")) - (stub mastodon-client-make-user-active) + (mock (mastodon-client--store-access-token "foobaz")) + (stub mastodon-client--make-user-active) (should (string= (mastodon-auth--access-token) "foobaz")) diff --git a/test/mastodon-client-tests.el b/test/mastodon-client-tests.el index c2ec50c..b302ed6 100644 --- a/test/mastodon-client-tests.el +++ b/test/mastodon-client-tests.el @@ -122,11 +122,11 @@ (should (equal mastodon-client--client-details-alist '(("http://mastodon.example" :client_id "foo" :client_secret "baz"))))))) -(ert-deftest mastodon-client-form-user-from-vars () +(ert-deftest mastodon-client--form-user-from-vars () (let ((mastodon-active-user "test9000") (mastodon-instance-url "https://mastodon.example")) (should - (equal (mastodon-client-form-user-from-vars) + (equal (mastodon-client--form-user-from-vars) "test9000@mastodon.example")))) (ert-deftest mastodon-client--current-user-active-p () @@ -142,7 +142,7 @@ (mock (mastodon-client--general-read "active-user") => '(:username "user@other.example" :client_id "id1")) (should (null (mastodon-client--current-user-active-p)))))) -(ert-deftest mastodon-client-store-access-token () +(ert-deftest mastodon-client--store-access-token () (let ((mastodon-instance-url "https://mastodon.example") (mastodon-active-user "test8000") (user-details @@ -150,14 +150,14 @@ :instance "https://mastodon.example" :client_id "id" :client_secret "secret" :access_token "token"))) - ;; test if mastodon-client-store-access-token /returns/ right + ;; test if mastodon-client--store-access-token /returns/ right ;; value (with-mock (mock (mastodon-client) => '(:client_id "id" :client_secret "secret")) (mock (mastodon-client--token-file) => "stubfile.plstore") - (should (equal (mastodon-client-store-access-token "token") + (should (equal (mastodon-client--store-access-token "token") user-details))) - ;; test if mastodon-client-store-access-token /stores/ right value + ;; test if mastodon-client--store-access-token /stores/ right value (with-mock (mock (mastodon-client--token-file) => "stubfile.plstore") (should (equal (mastodon-client--general-read @@ -165,10 +165,10 @@ user-details))) (delete-file "stubfile.plstore"))) -(ert-deftest mastodon-client-make-user-active () +(ert-deftest mastodon-client--make-user-active () (let ((user-details '(:username "test@mastodon.example"))) (with-mock (mock (mastodon-client--token-file) => "stubfile.plstore") - (mastodon-client-make-user-active user-details) + (mastodon-client--make-user-active user-details) (should (equal (mastodon-client--general-read "active-user") user-details))))) -- cgit v1.2.3 From 92f898f0a90760078a1bbfc843568e858891b6c9 Mon Sep 17 00:00:00 2001 From: Abhiseck Paira Date: Fri, 25 Feb 2022 20:42:48 +0530 Subject: test: add `mastodon-auth--user-unaware' Test for the situation when old mastodon.el users are unaware of the variable `mastodon-active-user'. --- test/mastodon-auth-tests.el | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'test') diff --git a/test/mastodon-auth-tests.el b/test/mastodon-auth-tests.el index 3bf65b2..3ecac30 100644 --- a/test/mastodon-auth-tests.el +++ b/test/mastodon-auth-tests.el @@ -64,3 +64,11 @@ (should (equal mastodon-auth--token-alist '(("https://instance.url" . "foobaz"))))))) + +(ert-deftest mastodon-auth--user-unaware () + (let ((mastodon-instance-url "https://instance.url") + (mastodon-active-user nil) + (mastodon-auth--token-alist nil)) + (with-mock + (mock (mastodon-client--active-user)) + (should-error (mastodon-auth--access-token))))) -- cgit v1.2.3 From 523ccea77d0968016973aefe55a92d9ebfd0b451 Mon Sep 17 00:00:00 2001 From: Abhiseck Paira Date: Fri, 25 Feb 2022 20:46:33 +0530 Subject: test: fix `mastodon-auth--access-token-not-found' --- test/mastodon-auth-tests.el | 1 + 1 file changed, 1 insertion(+) (limited to 'test') diff --git a/test/mastodon-auth-tests.el b/test/mastodon-auth-tests.el index 3ecac30..2d9d6df 100644 --- a/test/mastodon-auth-tests.el +++ b/test/mastodon-auth-tests.el @@ -53,6 +53,7 @@ (ert-deftest mastodon-auth--access-token-not-found () "Should set and return `mastodon-auth--token' if nil." (let ((mastodon-instance-url "https://instance.url") + (mastodon-active-user "user") (mastodon-auth--token-alist nil)) (with-mock (mock (mastodon-auth--get-token) => '(:access_token "foobaz")) -- cgit v1.2.3