Permalink
Browse files

Let Stackpy.sites() take kwargs (e.g. for pagesize)

  • Loading branch information...
1 parent 2cc2501 commit 324dd07ce9ab382322fdf9a0661bc02cce14286b @doismellburning committed Jun 9, 2012
Showing with 8 additions and 2 deletions.
  1. +2 −2 stackpy.py
  2. +6 −0 test.py
View
@@ -64,8 +64,8 @@ def _decompress(self, data):
data = gzipfile.read()
return data
- def sites(self):
- return self._api_fetch('/sites', siteless=True, item_type=Site)
+ def sites(self, **kwargs):
+ return self._api_fetch('/sites', siteless=True, item_type=Site, **kwargs)
def users(self, ids=None, **kwargs):
if ids is not None:
View
@@ -61,5 +61,11 @@ def test_paging(self):
self.assertFalse(r.has_more)
self.assertEqual(r.items, [])
+ def test_sites(self):
+ self.stackpy.sites()
+ sites = self.stackpy.sites(pagesize=1).items
+ self.assertEqual(len(sites), 1)
+
+
if __name__ == '__main__':
unittest.main()

0 comments on commit 324dd07

Please sign in to comment.