Skip to content

Commit b74d3fe

Browse files
authored
Merge pull request #32 from getoriginal/feature/ori-2192-asset-add-tests-for-optional-client_id-in-python-sdk
fix(ORI-2192): e2e tests for optional client_id in asset
2 parents 1496a99 + 4b53b1c commit b74d3fe

File tree

2 files changed

+42
-0
lines changed

2 files changed

+42
-0
lines changed

original_sdk/tests/e2e/test_async_client_e2e.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,28 @@ async def test_create_asset(self, async_client: OriginalAsyncClient):
104104
response = await async_client.create_asset(**request_data)
105105
assert response["data"]["uid"] is not None
106106

107+
async def test_create_asset_with_no_client_id(
108+
self, async_client: OriginalAsyncClient
109+
):
110+
asset_name = get_random_string(8)
111+
asset_data = {
112+
"name": asset_name,
113+
"unique_name": True,
114+
"image_url": "https://example.com/image.png",
115+
"store_image_on_ipfs": False,
116+
"attributes": [
117+
{"trait_type": "Eyes", "value": "Green"},
118+
{"trait_type": "Hair", "value": "Black"},
119+
],
120+
}
121+
request_data = {
122+
"data": asset_data,
123+
"user_uid": TEST_APP_USER_UID,
124+
"collection_uid": TEST_APP_COLLECTION_UID,
125+
}
126+
response = await async_client.create_asset(**request_data)
127+
assert response["data"]["uid"] is not None
128+
107129
async def test_edit_asset(self, async_client: OriginalAsyncClient):
108130
asset_name = get_random_string(8)
109131
asset_data = {

original_sdk/tests/e2e/test_client_e2e.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,26 @@ def test_create_asset(self, client: OriginalClient):
9797
response = client.create_asset(**request_data)
9898
assert response["data"]["uid"] is not None
9999

100+
def test_create_asset_with_no_client_id(self, client: OriginalClient):
101+
asset_name = get_random_string(8)
102+
asset_data = {
103+
"name": asset_name,
104+
"unique_name": True,
105+
"image_url": "https://example.com/image.png",
106+
"store_image_on_ipfs": False,
107+
"attributes": [
108+
{"trait_type": "Eyes", "value": "Green"},
109+
{"trait_type": "Hair", "value": "Black"},
110+
],
111+
}
112+
request_data = {
113+
"data": asset_data,
114+
"user_uid": TEST_APP_USER_UID,
115+
"collection_uid": TEST_APP_COLLECTION_UID,
116+
}
117+
response = client.create_asset(**request_data)
118+
assert response["data"]["uid"] is not None
119+
100120
def test_edit_asset(self, client: OriginalClient):
101121
asset_name = get_random_string(8)
102122
asset_data = {

0 commit comments

Comments
 (0)