Skip to content

Commit 5a372fc

Browse files
committed
Add test_slice, fix get slice
1 parent cdea274 commit 5a372fc

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

labelbox/client.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1559,8 +1559,7 @@ def get_catalog_slice(self, slice_id) -> CatalogSlice:
15591559
Returns:
15601560
CatalogSlice
15611561
"""
1562-
query_str = """
1563-
query getSavedQueryPyApi($id: ID!) {
1562+
query_str = """query getSavedQueryPyApi($id: ID!) {
15641563
getSavedQuery(id: $id) {
15651564
id
15661565
name

tests/integration/test_slice.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import pytest
2+
3+
4+
def test_export_v2_slice(client):
5+
# Since we don't have CRUD for slices, we'll just use the one that's already there
6+
SLICE_ID = "clfgqf1c72mk107zx6ypo9bse"
7+
slice = client.get_catalog_slice(SLICE_ID)
8+
task = slice.export_v2(params={
9+
"performance_details": False,
10+
"label_details": True
11+
})
12+
task.wait_till_done()
13+
assert task.status == "COMPLETE"
14+
assert task.errors is None
15+
assert len(task.result) != 0

0 commit comments

Comments
 (0)