diff options
author | Artur Malabarba <bruce.connor.am@gmail.com> | 2015-01-24 01:58:32 -0200 |
---|---|---|
committer | Artur Malabarba <bruce.connor.am@gmail.com> | 2015-01-24 01:59:10 -0200 |
commit | 458231a11d0d54f8d7011addd9246661898cb2e0 (patch) | |
tree | e2bd2b77d82ea49a0bd6a5d6b7fe3f7838ddd767 | |
parent | ba80f6594f39b09a6212f1288297ad1a6124dcbe (diff) |
Fix and reorganize tests
-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))))) |