Skip to content

Commit 96f1b99

Browse files
committed
Added max token_ids length validation method for the OrdersEndpoint
1 parent 1cbe92b commit 96f1b99

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

open_sea_v1/endpoints/tests/test_orders.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ def test_attr_token_ids_raises_if_len_is_above_30(self):
3636
self.endpoint_kwargs |= dict(asset_contract_address=self.asset_contract_address, token_ids=list(range(1, 32)))
3737
self.assertRaises(ValueError, OrdersEndpoint, **self.endpoint_kwargs)
3838

39+
def test_attr_token_ids_raises_if_len_is_above_30(self):
40+
self.endpoint_kwargs |= dict(asset_contract_address=self.asset_contract_address, token_ids=list(range(1, 32)))
41+
self.assertRaises(ValueError, OrdersEndpoint, **self.endpoint_kwargs)
42+
3943
def test_attr_token_ids_raises_if_not_defined_together_with_asset_contract_address(self):
4044
self.endpoint_kwargs |= dict(token_ids=[1, 2])
4145
self.assertRaises(AttributeError, OrdersEndpoint, **self.endpoint_kwargs)

open_sea_v1/responses/order.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class OrderResponse(BaseResponse):
1414
_json: dict
1515

1616
def __str__(self):
17-
return f"order_id={self.id}"
17+
return f"order_id={self.id} {str(self.asset)}"
1818

1919
def __post_init__(self):
2020
self._set_common_attrs()

0 commit comments

Comments
 (0)