diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/test-api.el | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/test/test-api.el b/test/test-api.el index f7f54c1..0715a2e 100644 --- a/test/test-api.el +++ b/test/test-api.el @@ -15,16 +15,18 @@ "Tests sx-method interface to `sx-request-all-items'" (should (< 250 (length (sx-method-call 'sites :get-all t))))) -(ert-deftest request-get () +(ert-deftest request-get-url () (should (sx-request-get-url "http://google.com")) (should-error (sx-request-get-url "http://github.com/Bruce-Connor/does-not-exist")) - (should-error (sx-request-get-data "tags/emacs-does-not-exist")) - (let ((emacs-tags (length (sx-request-get-data 'tags/emacs)))) - (should (> emacs-tags 450)) - (should (not (cl-remove-if #'stringp emacs-tags)))) (should ;; If image is not recognized, this returns nil. (create-image (sx-request-get-url "https://raw.githubusercontent.com/vermiculus/sx.el/master/list-and-question.png") 'imagemagick t :width (min sx-question-mode-image-max-width (window-body-width nil 'pixel))))) + +(ert-deftest request-get-data () + (should-error (sx-request-get-data "tags/emacs-does-not-exist")) + (let ((emacs-tags (sx-request-get-data 'tags/emacs))) + (should (> (length emacs-tags) 450)) + (should (not (cl-remove-if #'stringp emacs-tags))))) |