diff --git a/CHANGELOG.md b/CHANGELOG.md index 7448ef5a..222f34d1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,8 @@ Given a version number MAJOR.MINOR.PATCH, increment: ## [Unreleased] +### Fixed +- CorporatePurchase page method ## [2.25.1] - 2024-04-01 ### Fixed diff --git a/starkbank/corporatepurchase/__init__.py b/starkbank/corporatepurchase/__init__.py index 6724c0c8..21012206 100644 --- a/starkbank/corporatepurchase/__init__.py +++ b/starkbank/corporatepurchase/__init__.py @@ -1,3 +1,3 @@ from . import log from .log.__log import Log -from .__corporatepurchase import query, get, parse, response +from .__corporatepurchase import query, get, page, parse, response diff --git a/tests/sdk/test_corporate_purchase.py b/tests/sdk/test_corporate_purchase.py index 04265c9c..b57a072a 100644 --- a/tests/sdk/test_corporate_purchase.py +++ b/tests/sdk/test_corporate_purchase.py @@ -8,6 +8,22 @@ starkbank.user = exampleProject +class TestCorporatePurchasePage(TestCase): + + def test_success(self): + cursor = None + ids = [] + for _ in range(2): + purchases, cursor = starkbank.corporatepurchase.page(limit=2, cursor=cursor) + for purchase in purchases: + print(purchase) + self.assertFalse(purchase.id in ids) + ids.append(purchase.id) + if cursor is None: + break + self.assertTrue(len(ids) == 4) + + class TestCorporatePurchaseQuery(TestCase): def test_success(self):