Skip to content

Commit 4e20ff6

Browse files
test: Update remove shared link integration tests (box/box-codegen#690) (#529)
1 parent 6923750 commit 4e20ff6

File tree

8 files changed

+52
-5
lines changed

8 files changed

+52
-5
lines changed

.codegen.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{ "engineHash": "3ff590c", "specHash": "c303afc", "version": "1.13.0" }
1+
{ "engineHash": "abf4f7d", "specHash": "c303afc", "version": "1.13.0" }

docs/shared_links_files.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,13 @@ This operation is performed by calling function `remove_shared_link_from_file`.
174174
See the endpoint docs at
175175
[API Reference](https://developer.box.com/reference/put-files-id--remove-shared-link/).
176176

177-
_Currently we don't have an example for calling `remove_shared_link_from_file` in integration tests_
177+
<!-- sample put_files_id#remove_shared_link -->
178+
179+
```python
180+
client.shared_links_files.remove_shared_link_from_file(
181+
file_id, "shared_link", shared_link=create_null()
182+
)
183+
```
178184

179185
### Arguments
180186

docs/shared_links_folders.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,13 @@ This operation is performed by calling function `remove_shared_link_from_folder`
171171
See the endpoint docs at
172172
[API Reference](https://developer.box.com/reference/put-folders-id--remove-shared-link/).
173173

174-
_Currently we don't have an example for calling `remove_shared_link_from_folder` in integration tests_
174+
<!-- sample put_folders_id#remove_shared_link -->
175+
176+
```python
177+
client.shared_links_folders.remove_shared_link_from_folder(
178+
folder.id, "shared_link", shared_link=create_null()
179+
)
180+
```
175181

176182
### Arguments
177183

docs/shared_links_web_links.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,13 @@ This operation is performed by calling function `remove_shared_link_from_web_lin
171171
See the endpoint docs at
172172
[API Reference](https://developer.box.com/reference/put-web-links-id--remove-shared-link/).
173173

174-
_Currently we don't have an example for calling `remove_shared_link_from_web_link` in integration tests_
174+
<!-- sample put_web_links_id#remove_shared_link -->
175+
176+
```python
177+
client.shared_links_web_links.remove_shared_link_from_web_link(
178+
web_link_id, "shared_link", shared_link=create_null()
179+
)
180+
```
175181

176182
### Arguments
177183

test/shared_links_app_items.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
client: BoxClient = get_default_client()
1212

1313

14-
def testSharedLinksFiles():
14+
def testSharedLinksAppItems():
1515
app_item_shared_link: str = get_env_var('APP_ITEM_SHARED_LINK')
1616
app_item: AppItem = client.shared_links_app_items.find_app_item_for_shared_link(
1717
''.join(['shared_link=', app_item_shared_link])

test/shared_links_files.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@
3434

3535
from test.commons import get_default_client_with_user_subject
3636

37+
from box_sdk_gen.internal.utils import create_null
38+
3739
client: BoxClient = get_default_client()
3840

3941

@@ -88,4 +90,11 @@ def testSharedLinksFiles():
8890
),
8991
)
9092
assert to_string(updated_file.shared_link.access) == 'collaborators'
93+
client.shared_links_files.remove_shared_link_from_file(
94+
file_id, 'shared_link', shared_link=create_null()
95+
)
96+
file_from_api_after_remove: FileFull = (
97+
client.shared_links_files.get_shared_link_for_file(file_id, 'shared_link')
98+
)
99+
assert file_from_api_after_remove.shared_link == None
91100
client.files.delete_file_by_id(file_id)

test/shared_links_folders.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@
3030

3131
from test.commons import get_default_client_with_user_subject
3232

33+
from box_sdk_gen.internal.utils import create_null
34+
3335
client: BoxClient = get_default_client()
3436

3537

@@ -82,4 +84,11 @@ def testSharedLinksFolders():
8284
)
8385
)
8486
assert to_string(updated_folder.shared_link.access) == 'collaborators'
87+
client.shared_links_folders.remove_shared_link_from_folder(
88+
folder.id, 'shared_link', shared_link=create_null()
89+
)
90+
folder_from_api_after_remove: FolderFull = (
91+
client.shared_links_folders.get_shared_link_for_folder(folder.id, 'shared_link')
92+
)
93+
assert folder_from_api_after_remove.shared_link == None
8594
client.folders.delete_folder_by_id(folder.id)

test/shared_links_web_links.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@
3434

3535
from test.commons import get_default_client_with_user_subject
3636

37+
from box_sdk_gen.internal.utils import create_null
38+
3739
client: BoxClient = get_default_client()
3840

3941

@@ -94,4 +96,13 @@ def testSharedLinksWebLinks():
9496
)
9597
)
9698
assert to_string(updated_web_link.shared_link.access) == 'collaborators'
99+
client.shared_links_web_links.remove_shared_link_from_web_link(
100+
web_link_id, 'shared_link', shared_link=create_null()
101+
)
102+
web_link_from_api_after_remove: WebLink = (
103+
client.shared_links_web_links.get_shared_link_for_web_link(
104+
web_link_id, 'shared_link'
105+
)
106+
)
107+
assert web_link_from_api_after_remove.shared_link == None
97108
client.web_links.delete_web_link_by_id(web_link_id)

0 commit comments

Comments
 (0)