diff options
author | Sean Allred <code@seanallred.com> | 2014-10-31 18:51:00 -0400 |
---|---|---|
committer | Sean Allred <code@seanallred.com> | 2014-10-31 18:51:00 -0400 |
commit | 55111f36af271b85f452d3774beb89b0aa85cfc6 (patch) | |
tree | 31db05e192140e0a28b848d3dafa5665c6772e39 /tests.el | |
parent | f0f3d7675d6510add4b28fac1cb5823a658c1ec8 (diff) |
Handle case where API response is compressed
The StackExchange API explicitly states that responses to requests are
gzipped. For some reason, they are not zipped when called locally on my
machine, but they are zipped when run from Travis CI.
I do not know if `url-retrieve-synchronously' is performing any magic.
When I curl the request, I receive a gzipped response (as expected). A
proper fix for this would be to somehow advise `url-*' to request as
curl does.
Diffstat (limited to 'tests.el')
-rw-r--r-- | tests.el | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -6,6 +6,8 @@ (unintern symbol))))) ;;; Tests + +(setq stack-core-remaining-api-requests-message-threshold 1000000000) (setq debug-on-error t) (require 'stack-core) @@ -13,9 +15,15 @@ (setq stack-core-remaining-api-requests-message-threshold 50000) +(ert-deftest test-basic-request () + "Test basic request functionality" + (should (stack-core-make-request "sites"))) + (ert-deftest test-question-retrieve () + "Test the ability to receive a list of questions." (should (stack-question-get-questions 'emacs))) (ert-deftest test-bad-request () + "Test a method given a bad set of keywords" (should-error (stack-core-make-request "questions" '(())))) |