Skip to content

Commit ef635e1

Browse files
test: Support ITests for Shared Link for App Items (box/box-codegen#673) (#508)
1 parent d1aa250 commit ef635e1

File tree

4 files changed

+30
-4
lines changed

4 files changed

+30
-4
lines changed

.codegen.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{ "engineHash": "41feeaa", "specHash": "c303afc", "version": "1.12.0" }
1+
{ "engineHash": "be67a6e", "specHash": "c303afc", "version": "1.12.0" }

box_sdk_gen/managers/shared_links_app_items.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def __init__(
4545
self.auth = auth
4646
self.network_session = network_session
4747

48-
def get_shared_item_app_items(
48+
def find_app_item_for_shared_link(
4949
self, boxapi: str, *, extra_headers: Optional[Dict[str, Optional[str]]] = None
5050
) -> AppItem:
5151
"""

docs/shared_links_app_items.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,18 @@ Returns the app item represented by a shared link.
88

99
The link can originate from the current enterprise or another.
1010

11-
This operation is performed by calling function `get_shared_item_app_items`.
11+
This operation is performed by calling function `find_app_item_for_shared_link`.
1212

1313
See the endpoint docs at
1414
[API Reference](https://developer.box.com/reference/get-shared-items--app-items/).
1515

16-
_Currently we don't have an example for calling `get_shared_item_app_items` in integration tests_
16+
<!-- sample get_shared_items#app_items -->
17+
18+
```python
19+
client.shared_links_app_items.find_app_item_for_shared_link(
20+
"".join(["shared_link=", app_item_shared_link])
21+
)
22+
```
1723

1824
### Arguments
1925

test/shared_links_app_items.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
from box_sdk_gen.internal.utils import to_string
2+
3+
from box_sdk_gen.client import BoxClient
4+
5+
from box_sdk_gen.schemas.app_item import AppItem
6+
7+
from box_sdk_gen.internal.utils import get_env_var
8+
9+
from test.commons import get_default_client
10+
11+
client: BoxClient = get_default_client()
12+
13+
14+
def testSharedLinksFiles():
15+
app_item_shared_link: str = get_env_var('APP_ITEM_SHARED_LINK')
16+
app_item: AppItem = client.shared_links_app_items.find_app_item_for_shared_link(
17+
''.join(['shared_link=', app_item_shared_link])
18+
)
19+
assert to_string(app_item.type) == 'app_item'
20+
assert app_item.application_type == 'hubs'

0 commit comments

Comments
 (0)