Skip to content

Commit

Permalink
Update tests to reflect that max per page is now 50, not 100
Browse files Browse the repository at this point in the history
  • Loading branch information
Simon Willison committed Mar 9, 2009
1 parent 23ce426 commit 24051e2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion guardianapi/mockapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def __init__(self):

def reset(self):
self.fetched = [] # (url, kwargs-dict) pairs
self.fake_total_results = 101
self.fake_total_results = 51

def get(self, url):
bits = urlparse.urlparse(url)
Expand Down
8 changes: 4 additions & 4 deletions guardianapi/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,14 +109,14 @@ def test_all_search(self):

def test_all_tags(self):
"tags().all() should magically paginate"
self.fetcher.fake_total_results = 301
self.fetcher.fake_total_results = 151
self.assertRequestCount(0)
results = self.client.tags(count = 100)
results = self.client.tags(count = 50)
self.assertRequestCount(1)
self.assertEqual(len(results.results()), 100)
self.assertEqual(len(results.results()), 50)
all_tags = list(results.all(sleep = 0))
self.assertRequestCount(4)
self.assertEqual(len(all_tags), 301)
self.assertEqual(len(all_tags), 151)

def test_request_search(self):
"client.request(url-to-search-results) should work correctly"
Expand Down

0 comments on commit 24051e2

Please sign in to comment.