@@ -27,11 +27,12 @@ def _mock_get_user_credential(*args, **kwargs):
2727 test_instance .addCleanup (patcher .stop )
2828
2929
30- EXISTING_CATALOG_NAME = 'default-pna-test'
31- EXISTING_RESOURCE_GROUP = 'internal-testing'
32- EXISTING_LOCATION = 'canadacentral'
33- EXISTING_SUBSCRIPTION_ID = '00000000-0000-0000-0000-000000000000'
34- EXISTING_USER_IDENTITY = '/subscriptions/{sub}/resourcegroups/internal-testing/providers/Microsoft.ManagedIdentity/userAssignedIdentities/aopc-mi-fix-test' .format (sub = EXISTING_SUBSCRIPTION_ID )
30+ # Pre-provisioned resources used by read-only and non-destructive tests
31+ TEST_CATALOG_NAME = 'geocatalog-cli-test'
32+ TEST_RG = 'internal-testing'
33+ TEST_LOCATION = 'canadacentral'
34+ TEST_SUBSCRIPTION_ID = '00000000-0000-0000-0000-000000000000'
35+ TEST_USER_IDENTITY = '/subscriptions/{sub}/resourcegroups/internal-testing/providers/Microsoft.ManagedIdentity/userAssignedIdentities/aopc-mi-fix-test' .format (sub = TEST_SUBSCRIPTION_ID )
3536
3637
3738class PlanetarycomputerScenario (ScenarioTest ):
@@ -41,17 +42,17 @@ def setUp(self):
4142 if not self .is_live :
4243 _patch_credential_for_playback (self )
4344 self .kwargs .update ({
44- 'rg' : EXISTING_RESOURCE_GROUP ,
45- 'name' : EXISTING_CATALOG_NAME ,
46- 'location' : EXISTING_LOCATION ,
45+ 'rg' : TEST_RG ,
46+ 'name' : TEST_CATALOG_NAME ,
47+ 'location' : TEST_LOCATION ,
4748 })
4849
4950 def test_geocatalog_show (self ):
5051 self .cmd (
5152 'planetarycomputer geocatalog show -g {rg} -n {name}' ,
5253 checks = [
53- JMESPathCheck ('name' , EXISTING_CATALOG_NAME ),
54- JMESPathCheck ('resourceGroup' , EXISTING_RESOURCE_GROUP ),
54+ JMESPathCheck ('name' , TEST_CATALOG_NAME ),
55+ JMESPathCheck ('resourceGroup' , TEST_RG ),
5556 JMESPathCheck ('properties.tier' , 'Basic' ),
5657 JMESPathCheck ('properties.autoGeneratedDomainNameLabelScope' , 'TenantReuse' ),
5758 JMESPathCheck ('properties.provisioningState' , 'Succeeded' ),
@@ -61,11 +62,11 @@ def test_geocatalog_show(self):
6162 def test_geocatalog_list_by_resource_group (self ):
6263 result = self .cmd ('planetarycomputer geocatalog list -g {rg}' ).get_output_in_json ()
6364 self .assertTrue (len (result ) >= 1 )
64- self .assertTrue (any (c ['name' ] == EXISTING_CATALOG_NAME for c in result ))
65+ self .assertTrue (any (c ['name' ] == TEST_CATALOG_NAME for c in result ))
6566
6667 def test_geocatalog_list_by_subscription (self ):
6768 result = self .cmd ('planetarycomputer geocatalog list' ).get_output_in_json ()
68- self .assertTrue (any (c ['name' ] == EXISTING_CATALOG_NAME for c in result ))
69+ self .assertTrue (any (c ['name' ] == TEST_CATALOG_NAME for c in result ))
6970
7071 def test_geocatalog_update_tags (self ):
7172 # Update tags
@@ -95,7 +96,7 @@ def test_geocatalog_update_tags(self):
9596 )
9697
9798 def test_geocatalog_identity_assign_user (self ):
98- self .kwargs ['user_identity' ] = EXISTING_USER_IDENTITY
99+ self .kwargs ['user_identity' ] = TEST_USER_IDENTITY
99100
100101 # Assign user-assigned identity
101102 self .cmd (
@@ -114,7 +115,7 @@ def test_geocatalog_identity_assign_user(self):
114115 )
115116
116117 def test_geocatalog_identity_remove_user (self ):
117- self .kwargs ['user_identity' ] = EXISTING_USER_IDENTITY
118+ self .kwargs ['user_identity' ] = TEST_USER_IDENTITY
118119
119120 # Ensure user identity is assigned first
120121 self .cmd (
@@ -201,7 +202,7 @@ def test_geocatalog_create_with_options(self, resource_group):
201202 'rg' : resource_group ,
202203 'name' : catalog_name ,
203204 'location' : 'canadacentral' ,
204- 'user_identity' : EXISTING_USER_IDENTITY ,
205+ 'user_identity' : TEST_USER_IDENTITY ,
205206 })
206207
207208 # Create with explicit tier, domain label scope, tags, and user-assigned identity
0 commit comments