Skip to content

Commit a3f1bae

Browse files
authored
Cosmos: test enhancements (#47501)
* remove text assertions * change resource names * api files attempt * Update cspell.json
1 parent a1a3183 commit a3f1bae

11 files changed

Lines changed: 5408 additions & 25 deletions

sdk/cosmos/azure-cosmos/api.md

Lines changed: 5392 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
apiMdSha256: de3b8c0f2a0405fac7152d562c982bf98bf7bb546c46f05e39164574e47f7f7a
2+
parserVersion: 0.3.28
3+
pythonVersion: 3.13.14
Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,24 @@
11
{
22
"ignoreWords": [
3+
"acked",
4+
"activityid",
35
"hdrh",
46
"hdrhistogram",
57
"dedup",
68
"deduped",
79
"deduping",
810
"dedupe",
911
"dedups",
12+
"llsn",
1013
"perfdb",
1114
"perfresults",
1215
"pkrange",
1316
"ppcb",
1417
"reindexing",
18+
"rerank",
1519
"reranker",
16-
"toctou"
20+
"responsecontinuationtokenlimitinkb",
21+
"toctou",
22+
"ufffd"
1723
]
1824
}

sdk/cosmos/azure-cosmos/tests/test_crud.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1982,7 +1982,7 @@ def test_get_resource_with_dictionary_and_object(self):
19821982
def test_delete_all_items_by_partition_key(self):
19831983
# create container via setup client (control-plane)
19841984
created_collection = self._create_container_for_test(
1985-
container_id='test_delete_all_items_by_partition_key ' + str(uuid.uuid4()),
1985+
container_id='test_delete_all_items_by_partition_key_' + str(uuid.uuid4()),
19861986
partition_key=PartitionKey(path='/pk', kind='Hash')
19871987
)
19881988
# Create two partition keys

sdk/cosmos/azure-cosmos/tests/test_crud_async.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1726,7 +1726,7 @@ async def test_get_resource_with_dictionary_and_object_async(self):
17261726
async def test_delete_all_items_by_partition_key_async(self):
17271727
# create container via setup client (control-plane)
17281728
created_collection = await self._create_container_for_test(
1729-
container_id='test_delete_all_items_by_partition_key ' + str(uuid.uuid4()),
1729+
container_id='test_delete_all_items_by_partition_key_' + str(uuid.uuid4()),
17301730
partition_key=PartitionKey(path='/pk', kind='Hash')
17311731
)
17321732
# Create two partition keys

sdk/cosmos/azure-cosmos/tests/test_crud_response_payload_on_write_disabled.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2638,7 +2638,7 @@ def test_delete_all_items_by_partition_key(self):
26382638

26392639
# create container via setup client (control-plane)
26402640
created_collection = key_db.create_container(
2641-
id='test_delete_all_items_by_partition_key ' + str(uuid.uuid4()),
2641+
id='test_delete_all_items_by_partition_key_' + str(uuid.uuid4()),
26422642
partition_key=PartitionKey(path='/pk', kind='Hash')
26432643
)
26442644
data_collection = data_db.get_container_client(created_collection.id)

sdk/cosmos/azure-cosmos/tests/test_crud_response_payload_on_write_disabled_async.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2329,7 +2329,7 @@ async def test_delete_all_items_by_partition_key_async(self):
23292329

23302330
# create container via setup client (control-plane)
23312331
created_collection = await key_db.create_container(
2332-
id='test_delete_all_items_by_partition_key ' + str(uuid.uuid4()),
2332+
id='test_delete_all_items_by_partition_key_' + str(uuid.uuid4()),
23332333
partition_key=PartitionKey(path='/pk', kind='Hash')
23342334
)
23352335
data_collection = data_db.get_container_client(created_collection.id)

sdk/cosmos/azure-cosmos/tests/test_full_text_policy.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -300,9 +300,6 @@ def test_fail_create_full_text_indexing_policy(self):
300300
# pytest.fail("Container creation should have failed for lack of embedding policy.")
301301
except exceptions.CosmosHttpResponseError as e:
302302
assert e.status_code == 400
303-
assert re.search(
304-
r"the path of the full.text index.*does not match the path specified in the full.text policy",
305-
e.http_error_message, re.IGNORECASE)
306303

307304
# Pass a full text indexing policy with a wrongly formatted path
308305
indexing_policy_wrong_path = {
@@ -320,9 +317,6 @@ def test_fail_create_full_text_indexing_policy(self):
320317
pytest.fail("Container creation should have failed for invalid path.")
321318
except exceptions.CosmosHttpResponseError as e:
322319
assert e.status_code == 400
323-
assert re.search(
324-
r"full.text index specification at index \(0\) contains invalid path",
325-
e.http_error_message, re.IGNORECASE)
326320

327321
# Pass a full text indexing policy without a path field
328322
indexing_policy_no_path = {
@@ -340,9 +334,6 @@ def test_fail_create_full_text_indexing_policy(self):
340334
pytest.fail("Container creation should have failed for missing path.")
341335
except exceptions.CosmosHttpResponseError as e:
342336
assert e.status_code == 400
343-
assert re.search(
344-
r"missing path in full.text index specification at index \(0\)",
345-
e.http_error_message, re.IGNORECASE)
346337

347338
# Skipped until testing pipeline is set up for full text multi-language support
348339
@pytest.mark.skip

sdk/cosmos/azure-cosmos/tests/test_full_text_policy_async.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -306,9 +306,6 @@ async def test_fail_create_full_text_indexing_policy_async(self):
306306
# pytest.fail("Container creation should have failed for lack of embedding policy.")
307307
except exceptions.CosmosHttpResponseError as e:
308308
assert e.status_code == 400
309-
assert re.search(
310-
r"the path of the full.text index.*does not match the path specified in the full.text policy",
311-
e.http_error_message, re.IGNORECASE)
312309

313310
# Pass a full text indexing policy with a wrongly formatted path
314311
indexing_policy_wrong_path = {
@@ -326,9 +323,6 @@ async def test_fail_create_full_text_indexing_policy_async(self):
326323
pytest.fail("Container creation should have failed for invalid path.")
327324
except exceptions.CosmosHttpResponseError as e:
328325
assert e.status_code == 400
329-
assert re.search(
330-
r"full.text index specification at index \(0\) contains invalid path",
331-
e.http_error_message, re.IGNORECASE)
332326

333327
# Pass a full text indexing policy without a path field
334328
indexing_policy_no_path = {
@@ -346,9 +340,6 @@ async def test_fail_create_full_text_indexing_policy_async(self):
346340
pytest.fail("Container creation should have failed for missing path.")
347341
except exceptions.CosmosHttpResponseError as e:
348342
assert e.status_code == 400
349-
assert re.search(
350-
r"missing path in full.text index specification at index \(0\)",
351-
e.http_error_message, re.IGNORECASE)
352343

353344
# Skipped until testing pipeline is set up for full text multi-language support
354345
@pytest.mark.skip

sdk/cosmos/azure-cosmos/tests/test_headers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ def test_container_delete_item_throughput_bucket(self):
269269
def test_container_delete_all_items_by_partition_key_throughput_bucket(self):
270270
# Control-plane container creation.
271271
created_collection_ref = self.database.create_container(
272-
id='test_delete_all_items_by_partition_key ' + str(uuid.uuid4()),
272+
id='test_delete_all_items_by_partition_key_' + str(uuid.uuid4()),
273273
partition_key=PartitionKey(path='/pk', kind='Hash'))
274274
data_collection = self.data_database.get_container_client(created_collection_ref.id)
275275

0 commit comments

Comments
 (0)