From 55111f36af271b85f452d3774beb89b0aa85cfc6 Mon Sep 17 00:00:00 2001 From: Sean Allred Date: Fri, 31 Oct 2014 18:51:00 -0400 Subject: 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. --- tests.el | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'tests.el') diff --git a/tests.el b/tests.el index 0c2af0f..379c903 100644 --- a/tests.el +++ b/tests.el @@ -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" '(())))) -- cgit v1.2.3