Skip to content

Commit 05372ee

Browse files
authored
Add various sdk test improvements: (#1272)
2 parents 82373e9 + 859c3c4 commit 05372ee

File tree

2 files changed

+16
-5
lines changed

2 files changed

+16
-5
lines changed

tests/data/annotation_types/data/test_text.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def test_text():
2222

2323

2424
def test_url():
25-
url = "https://filesamples.com/samples/document/txt/sample3.txt"
25+
url = "https://storage.googleapis.com/lb-artifacts-testing-public/sdk_integration_test/sample3.txt"
2626
text_data = TextData(url=url)
2727
text = text_data.value
2828
assert len(text) == 3541

tests/integration/test_data_rows.py

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -964,8 +964,8 @@ def test_data_row_bulk_creation_sync_with_same_global_keys(
964964
assert list(dataset.data_rows())[0].global_key == global_key_1
965965

966966

967-
@pytest.mark.skip(reason="create_data_rows_sync not supported by ADV yet")
968-
def test_create_conversational_text(client, dataset, conversational_content):
967+
@pytest.fixture
968+
def converstational_data_rows(dataset, conversational_content):
969969
examples = [
970970
{
971971
**conversational_content, 'media_type':
@@ -976,9 +976,20 @@ def test_create_conversational_text(client, dataset, conversational_content):
976976
"conversationalData": conversational_content['row_data']['messages']
977977
} # Old way to check for backwards compatibility
978978
]
979-
dataset.create_data_rows_sync(examples)
979+
task = dataset.create_data_rows(examples)
980+
task.wait_till_done()
981+
assert task.status == "COMPLETE"
982+
980983
data_rows = list(dataset.data_rows())
981-
assert len(data_rows) == len(examples)
984+
985+
yield data_rows
986+
for dr in data_rows:
987+
dr.delete()
988+
989+
990+
def test_create_conversational_text(converstational_data_rows,
991+
conversational_content):
992+
data_rows = converstational_data_rows
982993
for data_row in data_rows:
983994
assert requests.get(
984995
data_row.row_data).json() == conversational_content['row_data']

0 commit comments

Comments
 (0)