From 27eb38cfc4bba9013e8454bbe81ce497bf224474 Mon Sep 17 00:00:00 2001 From: Sean Allred Date: Fri, 2 Jan 2015 00:59:59 -0500 Subject: Introduce `sx-request-all-items' This function repeatedly makes API requests until a condition is satisfied (such as 'no more items'). First and foremost, this will allow us to retrieve all tags for a site. --- test/test-api.el | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'test/test-api.el') diff --git a/test/test-api.el b/test/test-api.el index ca775ff..b99ec7a 100644 --- a/test/test-api.el +++ b/test/test-api.el @@ -11,3 +11,8 @@ (should-error (sx-request-make "questions" '(())))) +(ert-deftest test-request-all () + "Test request all items" + (should + (< 250 + (length (sx-request-all-items "sites"))))) -- cgit v1.2.3 From dea60197cf658925827ccf3d10080dc4c0a22c40 Mon Sep 17 00:00:00 2001 From: Sean Allred Date: Fri, 2 Jan 2015 19:35:33 -0500 Subject: Test new sx-method functionality --- test/test-api.el | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'test/test-api.el') diff --git a/test/test-api.el b/test/test-api.el index b99ec7a..8e71eb2 100644 --- a/test/test-api.el +++ b/test/test-api.el @@ -16,3 +16,7 @@ (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)))) -- cgit v1.2.3 From 63dcca1acd08c0d103196a5d35a581d5380d3717 Mon Sep 17 00:00:00 2001 From: Sean Allred Date: Fri, 2 Jan 2015 19:37:07 -0500 Subject: Fix test Dumb mistake -- I wasn't taking the length of the request before comparing it. --- test/test-api.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test/test-api.el') diff --git a/test/test-api.el b/test/test-api.el index 8e71eb2..91a8adb 100644 --- a/test/test-api.el +++ b/test/test-api.el @@ -19,4 +19,4 @@ (ert-deftest test-method-get-all () "Tests sx-method interface to `sx-request-all-items'" - (should (< 250 (sx-method-call 'sites :get-all t)))) + (should (< 250 (length (sx-method-call 'sites :get-all t))))) -- cgit v1.2.3 From ea2e7287b1c4965ab30da749624a06d5f4e5a9e3 Mon Sep 17 00:00:00 2001 From: Sean Allred Date: Sat, 3 Jan 2015 23:16:58 -0500 Subject: Remove unneeded test This test is largely unneeded and (currently) almost doubles the test time. --- test/test-api.el | 6 ------ 1 file changed, 6 deletions(-) (limited to 'test/test-api.el') diff --git a/test/test-api.el b/test/test-api.el index 91a8adb..b7d5dbb 100644 --- a/test/test-api.el +++ b/test/test-api.el @@ -11,12 +11,6 @@ (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 (length (sx-method-call 'sites :get-all t))))) -- cgit v1.2.3