aboutsummaryrefslogtreecommitdiff
path: root/test/test-api.el
blob: 8e71eb2f8eb9366845edd68c5334ceb465405c31 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
(ert-deftest test-basic-request ()
  "Test basic request functionality"
  (should (sx-request-make "sites")))

(ert-deftest test-question-retrieve ()
  "Test the ability to receive a list of questions."
  (should (sx-question-get-questions 'emacs)))

(ert-deftest test-bad-request ()
  "Test a method given a bad set of keywords"
  (should-error
   (sx-request-make "questions" '(()))))

(ert-deftest test-request-all ()
  "Test request all items"
  (should
   (< 250
      (length (sx-request-all-items "sites")))))

(ert-deftest test-method-get-all ()
  "Tests sx-method interface to `sx-request-all-items'"
  (should (< 250 (sx-method-call 'sites :get-all t))))