Skip to content

Commit f30b5f3

Browse files
Sanitize test catalog names in recordings and test constants
1 parent ad26d3e commit f30b5f3

8 files changed

Lines changed: 107 additions & 106 deletions

src/planetarycomputer/azext_planetarycomputer/tests/latest/recordings/test_geocatalog_identity_assign_user.yaml

Lines changed: 14 additions & 14 deletions
Large diffs are not rendered by default.

src/planetarycomputer/azext_planetarycomputer/tests/latest/recordings/test_geocatalog_identity_remove_user.yaml

Lines changed: 25 additions & 25 deletions
Large diffs are not rendered by default.

src/planetarycomputer/azext_planetarycomputer/tests/latest/recordings/test_geocatalog_list_by_resource_group.yaml

Lines changed: 9 additions & 9 deletions
Large diffs are not rendered by default.

src/planetarycomputer/azext_planetarycomputer/tests/latest/recordings/test_geocatalog_list_by_subscription.yaml

Lines changed: 9 additions & 9 deletions
Large diffs are not rendered by default.

src/planetarycomputer/azext_planetarycomputer/tests/latest/recordings/test_geocatalog_show.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ interactions:
1515
User-Agent:
1616
- AZURECLI/2.84.0 azsdk-python-core/1.38.3 Python/3.10.12 (Linux-5.15.167.4-microsoft-standard-WSL2-x86_64-with-glibc2.35)
1717
method: GET
18-
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/internal-testing/providers/Microsoft.Orbital/geoCatalogs/default-pna-test?api-version=2026-04-15
18+
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/internal-testing/providers/Microsoft.Orbital/geoCatalogs/geocatalog-cli-test?api-version=2026-04-15
1919
response:
2020
body:
21-
string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/internal-testing/providers/Microsoft.Orbital/geoCatalogs/default-pna-test","name":"default-pna-test","type":"microsoft.orbital/geocatalogs","location":"Canada
22-
Central","tags":{},"systemData":{"createdBy":"user@example.com","createdByType":"User","createdAt":"2026-03-26T17:43:40.1776624Z","lastModifiedBy":"user@example.com","lastModifiedByType":"User","lastModifiedAt":"2026-03-27T18:50:40.313021Z"},"identity":{"type":"None"},"properties":{"tier":"Basic","catalogUri":"https://default-pna-test.b8etffb4a4afbke7.canadacentral.geocatalog.spatio-ppe.azure-test.net","provisioningState":"Succeeded","autoGeneratedDomainNameLabelScope":"TenantReuse"}}'
21+
string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/internal-testing/providers/Microsoft.Orbital/geoCatalogs/geocatalog-cli-test","name":"geocatalog-cli-test","type":"microsoft.orbital/geocatalogs","location":"Canada
22+
Central","tags":{},"systemData":{"createdBy":"user@example.com","createdByType":"User","createdAt":"2026-03-26T17:43:40.1776624Z","lastModifiedBy":"user@example.com","lastModifiedByType":"User","lastModifiedAt":"2026-03-27T18:50:40.313021Z"},"identity":{"type":"None"},"properties":{"tier":"Basic","catalogUri":"https://geocatalog-cli-test.b8etffb4a4afbke7.canadacentral.geocatalog.spatio-ppe.azure-test.net","provisioningState":"Succeeded","autoGeneratedDomainNameLabelScope":"TenantReuse"}}'
2323
headers:
2424
cache-control:
2525
- no-cache

src/planetarycomputer/azext_planetarycomputer/tests/latest/recordings/test_geocatalog_update_tags.yaml

Lines changed: 25 additions & 25 deletions
Large diffs are not rendered by default.

src/planetarycomputer/azext_planetarycomputer/tests/latest/recordings/test_geocatalog_wait.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ interactions:
1515
User-Agent:
1616
- AZURECLI/2.84.0 azsdk-python-core/1.38.3 Python/3.10.12 (Linux-5.15.167.4-microsoft-standard-WSL2-x86_64-with-glibc2.35)
1717
method: GET
18-
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/internal-testing/providers/Microsoft.Orbital/geoCatalogs/default-pna-test?api-version=2026-04-15
18+
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/internal-testing/providers/Microsoft.Orbital/geoCatalogs/geocatalog-cli-test?api-version=2026-04-15
1919
response:
2020
body:
21-
string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/internal-testing/providers/Microsoft.Orbital/geoCatalogs/default-pna-test","name":"default-pna-test","type":"microsoft.orbital/geocatalogs","location":"Canada
22-
Central","tags":{},"systemData":{"createdBy":"user@example.com","createdByType":"User","createdAt":"2026-03-26T17:43:40.1776624Z","lastModifiedBy":"user@example.com","lastModifiedByType":"User","lastModifiedAt":"2026-03-27T18:51:57.7518332Z"},"identity":{"type":"None"},"properties":{"tier":"Basic","catalogUri":"https://default-pna-test.b8etffb4a4afbke7.canadacentral.geocatalog.spatio-ppe.azure-test.net","provisioningState":"Succeeded","autoGeneratedDomainNameLabelScope":"TenantReuse"}}'
21+
string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/internal-testing/providers/Microsoft.Orbital/geoCatalogs/geocatalog-cli-test","name":"geocatalog-cli-test","type":"microsoft.orbital/geocatalogs","location":"Canada
22+
Central","tags":{},"systemData":{"createdBy":"user@example.com","createdByType":"User","createdAt":"2026-03-26T17:43:40.1776624Z","lastModifiedBy":"user@example.com","lastModifiedByType":"User","lastModifiedAt":"2026-03-27T18:51:57.7518332Z"},"identity":{"type":"None"},"properties":{"tier":"Basic","catalogUri":"https://geocatalog-cli-test.b8etffb4a4afbke7.canadacentral.geocatalog.spatio-ppe.azure-test.net","provisioningState":"Succeeded","autoGeneratedDomainNameLabelScope":"TenantReuse"}}'
2323
headers:
2424
cache-control:
2525
- no-cache
@@ -66,11 +66,11 @@ interactions:
6666
User-Agent:
6767
- AZURECLI/2.84.0 azsdk-python-core/1.38.3 Python/3.10.12 (Linux-5.15.167.4-microsoft-standard-WSL2-x86_64-with-glibc2.35)
6868
method: GET
69-
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/internal-testing/providers/Microsoft.Orbital/geoCatalogs/default-pna-test?api-version=2026-04-15
69+
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/internal-testing/providers/Microsoft.Orbital/geoCatalogs/geocatalog-cli-test?api-version=2026-04-15
7070
response:
7171
body:
72-
string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/internal-testing/providers/Microsoft.Orbital/geoCatalogs/default-pna-test","name":"default-pna-test","type":"microsoft.orbital/geocatalogs","location":"Canada
73-
Central","tags":{},"systemData":{"createdBy":"user@example.com","createdByType":"User","createdAt":"2026-03-26T17:43:40.1776624Z","lastModifiedBy":"user@example.com","lastModifiedByType":"User","lastModifiedAt":"2026-03-27T18:51:57.7518332Z"},"identity":{"type":"None"},"properties":{"tier":"Basic","catalogUri":"https://default-pna-test.b8etffb4a4afbke7.canadacentral.geocatalog.spatio-ppe.azure-test.net","provisioningState":"Succeeded","autoGeneratedDomainNameLabelScope":"TenantReuse"}}'
72+
string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/internal-testing/providers/Microsoft.Orbital/geoCatalogs/geocatalog-cli-test","name":"geocatalog-cli-test","type":"microsoft.orbital/geocatalogs","location":"Canada
73+
Central","tags":{},"systemData":{"createdBy":"user@example.com","createdByType":"User","createdAt":"2026-03-26T17:43:40.1776624Z","lastModifiedBy":"user@example.com","lastModifiedByType":"User","lastModifiedAt":"2026-03-27T18:51:57.7518332Z"},"identity":{"type":"None"},"properties":{"tier":"Basic","catalogUri":"https://geocatalog-cli-test.b8etffb4a4afbke7.canadacentral.geocatalog.spatio-ppe.azure-test.net","provisioningState":"Succeeded","autoGeneratedDomainNameLabelScope":"TenantReuse"}}'
7474
headers:
7575
cache-control:
7676
- no-cache

src/planetarycomputer/azext_planetarycomputer/tests/latest/test_planetarycomputer.py

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -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

3738
class 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

Comments
 (0)