コード例 #1
0
 def test_offset(self, apimock):
     """
     Test the paginator handles setting the offset correctly
     """
     client = UsdaClient('SOME_KEY')
     result = client.list_foods_raw(max=10, offset=42)
     assert isinstance(result, RawPaginator)
     assert result.current_offset == 42
     with apimock:
         data = list(result)
     assert data == FOOD_LIST_DATA['list']['item']
コード例 #2
0
 def test_client_list_foods_raw(self, apimock):
     cli = UsdaClient("API_KAY")
     with apimock:
         data = list(cli.list_foods_raw(max=5))
     assert data == FOOD_LIST_DATA['list']['item']