Skip to content

Commit 39deb12

Browse files
committed
Fix soft delete test helper function name and clarify two-step account setup
- Renamed _update_account_with_soft_delete to _create_account_with_soft_delete to match all call sites - Updated docstring to explain that soft delete configuration can only be set via update command (platform limitation) - Updated log messages to reflect the two-step process (create then update)
1 parent 95e471c commit 39deb12

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/cosmosdb-preview/azext_cosmosdb_preview/tests/latest/test_cosmosdb_softdelete_scenario.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,12 @@ class CosmosDBSoftDeleteScenarioTest(ScenarioTest):
2929
Note: These tests require a CosmosDB account with soft-delete feature enabled.
3030
"""
3131

32-
def _update_account_with_soft_delete(self, account_name, resource_group, location):
32+
def _create_account_with_soft_delete(self, account_name, resource_group, location):
3333
"""
3434
Helper function to create a CosmosDB account and enable soft delete.
35+
36+
Note: Soft delete configuration (enable-soft-deletion, sd-retention, min-purge-minutes)
37+
can only be set via update command, not during create. This is a platform limitation.
3538
Sets retention period and minimum purge minutes to 0 for testing.
3639
"""
3740
self.kwargs.update({
@@ -43,14 +46,14 @@ def _update_account_with_soft_delete(self, account_name, resource_group, locatio
4346
logger.info("Creating CosmosDB account")
4447
self.cmd('az cosmosdb create -n {acc} -g {rg} --locations regionName={loc}')
4548

46-
logger.info("Enabling soft delete on account")
49+
logger.info("Enabling soft delete on account (must be done via update)")
4750
self.cmd(
4851
'az cosmosdb update -n {acc} -g {rg} '
4952
'--enable-soft-deletion true '
5053
'--sd-retention 0 '
5154
'--min-purge-minutes 0'
5255
)
53-
logger.info("Account created with soft delete enabled")
56+
logger.info("Account created and soft delete enabled")
5457

5558
@AllowLargeResponse()
5659
@ResourceGroupPreparer(name_prefix='cli_test_cosmosdb_softdelete_acc_recover', location='westus')

0 commit comments

Comments
 (0)