Skip to content

Commit f3d89cc

Browse files
authored
Update resources test (Azure#23340)
Co-authored-by: ZiWei Chen (WICRESOFT NORTH AMERICA LTD) <[email protected]>
1 parent cb93783 commit f3d89cc

9 files changed

+919
-938
lines changed

sdk/resources/azure-mgmt-resource/tests/conftest.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@
3131
from dotenv import load_dotenv
3232

3333
from devtools_testutils import test_proxy, add_general_regex_sanitizer
34+
from devtools_testutils import add_header_regex_sanitizer, add_body_key_sanitizer
35+
3436

3537
# Ignore async tests for Python < 3.5
3638
collect_ignore_glob = []
@@ -44,4 +46,7 @@ def add_sanitizers(test_proxy):
4446
subscription_id = os.environ.get("AZURE_SUBSCRIPTION_ID", "00000000-0000-0000-0000-000000000000")
4547
tenant_id = os.environ.get("AZURE_TENANT_ID", "00000000-0000-0000-0000-000000000000")
4648
add_general_regex_sanitizer(regex=subscription_id, value="00000000-0000-0000-0000-000000000000")
47-
add_general_regex_sanitizer(regex=tenant_id, value="00000000-0000-0000-0000-000000000000")
49+
add_general_regex_sanitizer(regex=tenant_id, value="00000000-0000-0000-0000-000000000000")
50+
add_header_regex_sanitizer(key="Set-Cookie", value="[set-cookie;]")
51+
add_header_regex_sanitizer(key="Cookie", value="cookie;")
52+
add_body_key_sanitizer(json_path="$..access_token", value="access_token")

sdk/resources/azure-mgmt-resource/tests/recordings/test_mgmt_resource_deployment_scripts.pyTestMgmtResourceDeploymentScripttest_deployment_scripts.json

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

sdk/resources/azure-mgmt-resource/tests/recordings/test_mgmt_resource_links.pyTestMgmtResourceLinkstest_links.json

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

sdk/resources/azure-mgmt-resource/tests/recordings/test_mgmt_resource_locks.pyTestMgmtResourceLockstest_locks_at_resource_group_level.json

Lines changed: 55 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"Accept": "*/*",
88
"Accept-Encoding": "gzip, deflate",
99
"Connection": "keep-alive",
10-
"User-Agent": "azsdk-python-identity/1.8.0 Python/3.8.8 (Windows-10-10.0.19041-SP0)"
10+
"User-Agent": "azsdk-python-identity/1.9.0b1 Python/3.9.10 (Windows-10-10.0.22000-SP0)"
1111
},
1212
"RequestBody": null,
1313
"StatusCode": 200,
@@ -17,17 +17,13 @@
1717
"Cache-Control": "max-age=86400, private",
1818
"Content-Length": "1753",
1919
"Content-Type": "application/json; charset=utf-8",
20-
"Date": "Tue, 25 Jan 2022 10:03:35 GMT",
20+
"Date": "Fri, 04 Mar 2022 08:43:28 GMT",
2121
"P3P": "CP=\u0022DSP CUR OTPi IND OTRi ONL FIN\u0022",
22-
"Set-Cookie": [
23-
"fpc=AoIiSpQDvylGqwYeeHVzaUOZHqKEBgAAAJ3BgdkOAAAA; expires=Thu, 24-Feb-2022 10:03:35 GMT; path=/; secure; HttpOnly; SameSite=None",
24-
"x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly",
25-
"stsservicecookie=estsfd; path=/; secure; samesite=none; httponly"
26-
],
22+
"Set-Cookie": "[set-cookie;]",
2723
"Strict-Transport-Security": "max-age=31536000; includeSubDomains",
2824
"X-Content-Type-Options": "nosniff",
29-
"x-ms-ests-server": "2.1.12261.22 - SCUS ProdSlices",
30-
"x-ms-request-id": "3e279765-9c38-4434-8348-1fe1fa42f900"
25+
"x-ms-ests-server": "2.1.12507.17 - NCUS ProdSlices",
26+
"x-ms-request-id": "7fe2b7d9-45f9-4dc3-bea8-242810b66e00"
3127
},
3228
"ResponseBody": {
3329
"token_endpoint": "https://login.microsoftonline.com/00000000-0000-0000-0000-000000000000/oauth2/v2.0/token",
@@ -104,8 +100,8 @@
104100
"Accept": "application/json",
105101
"Accept-Encoding": "gzip, deflate",
106102
"Connection": "keep-alive",
107-
"Cookie": "fpc=AoIiSpQDvylGqwYeeHVzaUOZHqKEBgAAAJ3BgdkOAAAA; stsservicecookie=estsfd; x-ms-gateway-slice=estsfd",
108-
"User-Agent": "azsdk-python-identity/1.8.0 Python/3.8.8 (Windows-10-10.0.19041-SP0)"
103+
"Cookie": "cookie;",
104+
"User-Agent": "azsdk-python-identity/1.9.0b1 Python/3.9.10 (Windows-10-10.0.22000-SP0)"
109105
},
110106
"RequestBody": null,
111107
"StatusCode": 200,
@@ -115,17 +111,13 @@
115111
"Cache-Control": "max-age=86400, private",
116112
"Content-Length": "945",
117113
"Content-Type": "application/json; charset=utf-8",
118-
"Date": "Tue, 25 Jan 2022 10:03:35 GMT",
114+
"Date": "Fri, 04 Mar 2022 08:43:29 GMT",
119115
"P3P": "CP=\u0022DSP CUR OTPi IND OTRi ONL FIN\u0022",
120-
"Set-Cookie": [
121-
"fpc=AoIiSpQDvylGqwYeeHVzaUOZHqKEBgAAAJ3BgdkOAAAA; expires=Thu, 24-Feb-2022 10:03:36 GMT; path=/; secure; HttpOnly; SameSite=None",
122-
"x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly",
123-
"stsservicecookie=estsfd; path=/; secure; samesite=none; httponly"
124-
],
116+
"Set-Cookie": "[set-cookie;]",
125117
"Strict-Transport-Security": "max-age=31536000; includeSubDomains",
126118
"X-Content-Type-Options": "nosniff",
127-
"x-ms-ests-server": "2.1.12381.20 - KRSLR1 ProdSlices",
128-
"x-ms-request-id": "16c0c1a8-7e57-4a92-82dd-c4e2c8aa1500"
119+
"x-ms-ests-server": "2.1.12529.17 - SEASLR2 ProdSlices",
120+
"x-ms-request-id": "0bf82154-3e6b-4659-9e29-e2a487e20e00"
129121
},
130122
"ResponseBody": {
131123
"tenant_discovery_endpoint": "https://login.microsoftonline.com/common/.well-known/openid-configuration",
@@ -180,47 +172,43 @@
180172
"RequestHeaders": {
181173
"Accept": "application/json",
182174
"Accept-Encoding": "gzip, deflate",
183-
"client-request-id": "de878d05-20de-4450-8908-af67c6cb1e30",
175+
"client-request-id": "cfb5d2c3-7456-4b86-ba66-be16e515e10b",
184176
"Connection": "keep-alive",
185177
"Content-Length": "289",
186178
"Content-Type": "application/x-www-form-urlencoded",
187-
"Cookie": "fpc=AoIiSpQDvylGqwYeeHVzaUOZHqKEBgAAAJ3BgdkOAAAA; stsservicecookie=estsfd; x-ms-gateway-slice=estsfd",
188-
"User-Agent": "azsdk-python-identity/1.8.0 Python/3.8.8 (Windows-10-10.0.19041-SP0)",
179+
"Cookie": "cookie;",
180+
"User-Agent": "azsdk-python-identity/1.9.0b1 Python/3.9.10 (Windows-10-10.0.22000-SP0)",
189181
"x-client-cpu": "x64",
190182
"x-client-current-telemetry": "4|730,0|",
191183
"x-client-last-telemetry": "4|0|||",
192184
"x-client-os": "win32",
193185
"x-client-sku": "MSAL.Python",
194-
"x-client-ver": "1.16.0",
186+
"x-client-ver": "1.17.0",
195187
"x-ms-lib-capability": "retry-after, h429"
196188
},
197189
"RequestBody": "client_id=a2df54d5-ab03-4725-9b80-9a00b3b1967f\u0026grant_type=client_credentials\u0026client_info=1\u0026client_secret=0vj7Q~IsFayrD0V_8oyOfygU-GE3ELOabq95a\u0026claims=%7B%22access_token%22%3A\u002B%7B%22xms_cc%22%3A\u002B%7B%22values%22%3A\u002B%5B%22CP1%22%5D%7D%7D%7D\u0026scope=https%3A%2F%2Fmanagement.azure.com%2F.default",
198190
"StatusCode": 200,
199191
"ResponseHeaders": {
200192
"Cache-Control": "no-store, no-cache",
201-
"client-request-id": "de878d05-20de-4450-8908-af67c6cb1e30",
202-
"Content-Length": "1391",
193+
"client-request-id": "cfb5d2c3-7456-4b86-ba66-be16e515e10b",
194+
"Content-Length": "93",
203195
"Content-Type": "application/json; charset=utf-8",
204-
"Date": "Tue, 25 Jan 2022 10:03:36 GMT",
196+
"Date": "Fri, 04 Mar 2022 08:43:29 GMT",
205197
"Expires": "-1",
206198
"P3P": "CP=\u0022DSP CUR OTPi IND OTRi ONL FIN\u0022",
207199
"Pragma": "no-cache",
208-
"Set-Cookie": [
209-
"fpc=AoIiSpQDvylGqwYeeHVzaUOZHqKEBwAAAJ3BgdkOAAAA; expires=Thu, 24-Feb-2022 10:03:36 GMT; path=/; secure; HttpOnly; SameSite=None",
210-
"x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly",
211-
"stsservicecookie=estsfd; path=/; secure; samesite=none; httponly"
212-
],
200+
"Set-Cookie": "[set-cookie;]",
213201
"Strict-Transport-Security": "max-age=31536000; includeSubDomains",
214202
"X-Content-Type-Options": "nosniff",
215203
"x-ms-clitelem": "1,0,0,,",
216-
"x-ms-ests-server": "2.1.12261.22 - NCUS ProdSlices",
217-
"x-ms-request-id": "71bfed6b-af3a-4635-8840-bd4d8c1b3300"
204+
"x-ms-ests-server": "2.1.12507.17 - SCUS ProdSlices",
205+
"x-ms-request-id": "157ea030-3e22-4ca1-adf8-d7ab658fb100"
218206
},
219207
"ResponseBody": {
220208
"token_type": "Bearer",
221209
"expires_in": 3599,
222210
"ext_expires_in": 3599,
223-
"access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6Ik1yNS1BVWliZkJpaTdOZDFqQmViYXhib1hXMCIsImtpZCI6Ik1yNS1BVWliZkJpaTdOZDFqQmViYXhib1hXMCJ9.eyJhdWQiOiJodHRwczovL21hbmFnZW1lbnQuYXp1cmUuY29tIiwiaXNzIjoiaHR0cHM6Ly9zdHMud2luZG93cy5uZXQvNTQ4MjZiMjItMzhkNi00ZmIyLWJhZDktYjdiOTNhM2U5YzVhLyIsImlhdCI6MTY0MzEwNDcxNiwibmJmIjoxNjQzMTA0NzE2LCJleHAiOjE2NDMxMDg2MTYsImFpbyI6IkUyWmdZT0F4YjczU1Z1LzMwTG14cUVWdm5kSi9BQT09IiwiYXBwaWQiOiJhMmRmNTRkNS1hYjAzLTQ3MjUtOWI4MC05YTAwYjNiMTk2N2YiLCJhcHBpZGFjciI6IjEiLCJpZHAiOiJodHRwczovL3N0cy53aW5kb3dzLm5ldC81NDgyNmIyMi0zOGQ2LTRmYjItYmFkOS1iN2I5M2EzZTljNWEvIiwiaWR0eXAiOiJhcHAiLCJvaWQiOiI4ODdjNDJiMS03OTQ2LTRjMjItYmFhNi0xNTA0M2U0YjEzMjMiLCJyaCI6IjAuQVRjQUltdUNWTlk0c2stNjJiZTVPajZjV3RWVTM2SURxeVZIbTRDYUFMT3hsbjgzQUFBLiIsInN1YiI6Ijg4N2M0MmIxLTc5NDYtNGMyMi1iYWE2LTE1MDQzZTRiMTMyMyIsInRpZCI6IjU0ODI2YjIyLTM4ZDYtNGZiMi1iYWQ5LWI3YjkzYTNlOWM1YSIsInV0aSI6ImEtMl9jVHF2TlVhSVFMMU5qQnN6QUEiLCJ2ZXIiOiIxLjAiLCJ4bXNfY2MiOlsiQ1AxIl0sInhtc190Y2R0IjoxNDEyMjA2ODQwfQ.abxlbYRSP8IwR7EPJBVOVETl0fDHtIq1x-60YRmhMSWIWjSWCuoYq8CVwbFp532VY8FFnaJSj-u-bSr2tJTtOk-icmiQvXy0db_SsvhCHjruDxnlJQgklComIUqL524YgHXK6oDeGgdN8G-y_OJshsOf6fxiexitqgOwK-ArAYVOCKT8aIFANvxhLG7zhkc2parGN54DL3JZryecY-A5JL90KhFsxQMuQ53ywFZLXy8XZui8_nbwSOTQDrLENTgAycw74_m924HzR4pchrwc9_Q4MUCT88ji-964H9lSxPh0igCNT6Ab4EWK4jHwO3SP_7ilBUw6yOP2NMRGglQGSA"
211+
"access_token": "access_token"
224212
}
225213
},
226214
{
@@ -233,24 +221,28 @@
233221
"Connection": "keep-alive",
234222
"Content-Length": "41",
235223
"Content-Type": "application/json",
236-
"User-Agent": "azsdk-python-azure-mgmt-resource/20.0.0 Python/3.8.8 (Windows-10-10.0.19041-SP0)",
237-
"x-ms-client-request-id": "0f03b6e7-7dc6-11ec-aee7-70b5e82527ff"
224+
"User-Agent": "azsdk-python-azure-mgmt-resource/20.1.0 Python/3.9.10 (Windows-10-10.0.22000-SP0)",
225+
"x-ms-client-request-id": "31e440e3-9b97-11ec-acd9-d08e79139a4a"
226+
},
227+
"RequestBody": {
228+
"properties": {
229+
"level": "CanNotDelete"
230+
}
238231
},
239-
"RequestBody": "{\u0022properties\u0022: {\u0022level\u0022: \u0022CanNotDelete\u0022}}",
240232
"StatusCode": 201,
241233
"ResponseHeaders": {
242234
"Cache-Control": "no-cache",
243235
"Content-Length": "226",
244236
"Content-Type": "application/json; charset=utf-8",
245-
"Date": "Tue, 25 Jan 2022 10:03:36 GMT",
237+
"Date": "Fri, 04 Mar 2022 08:43:30 GMT",
246238
"Expires": "-1",
247239
"Pragma": "no-cache",
248240
"Strict-Transport-Security": "max-age=31536000; includeSubDomains",
249241
"X-Content-Type-Options": "nosniff",
250-
"x-ms-correlation-request-id": "99390311-3aaa-4405-bc75-6712f6ce6fad",
251-
"x-ms-ratelimit-remaining-subscription-writes": "1191",
252-
"x-ms-request-id": "southeastasia:7d746344-eb6c-48f2-9551-3e357d26dda5",
253-
"x-ms-routing-request-id": "SOUTHEASTASIA:20220125T100336Z:99390311-3aaa-4405-bc75-6712f6ce6fad"
242+
"x-ms-correlation-request-id": "319ef80f-2d11-4c61-b388-e5f32efaed9b",
243+
"x-ms-ratelimit-remaining-subscription-writes": "1189",
244+
"x-ms-request-id": "southeastasia:2cb31426-f856-4f97-acba-6689f1f5a67d",
245+
"x-ms-routing-request-id": "SOUTHEASTASIA:20220304T084330Z:319ef80f-2d11-4c61-b388-e5f32efaed9b"
254246
},
255247
"ResponseBody": {
256248
"properties": {
@@ -269,16 +261,16 @@
269261
"Accept-Encoding": "gzip, deflate",
270262
"Authorization": "Sanitized",
271263
"Connection": "keep-alive",
272-
"User-Agent": "azsdk-python-azure-mgmt-resource/20.0.0 Python/3.8.8 (Windows-10-10.0.19041-SP0)",
273-
"x-ms-client-request-id": "0fa51f05-7dc6-11ec-910e-70b5e82527ff"
264+
"User-Agent": "azsdk-python-azure-mgmt-resource/20.1.0 Python/3.9.10 (Windows-10-10.0.22000-SP0)",
265+
"x-ms-client-request-id": "329045d2-9b97-11ec-9783-d08e79139a4a"
274266
},
275267
"RequestBody": null,
276268
"StatusCode": 200,
277269
"ResponseHeaders": {
278270
"Cache-Control": "no-cache",
279271
"Content-Encoding": "gzip",
280272
"Content-Type": "application/json; charset=utf-8",
281-
"Date": "Tue, 25 Jan 2022 10:03:36 GMT",
273+
"Date": "Fri, 04 Mar 2022 08:43:30 GMT",
282274
"Expires": "-1",
283275
"Pragma": "no-cache",
284276
"Strict-Transport-Security": "max-age=31536000; includeSubDomains",
@@ -288,10 +280,10 @@
288280
"Accept-Encoding"
289281
],
290282
"X-Content-Type-Options": "nosniff",
291-
"x-ms-correlation-request-id": "089933a0-235c-447d-b754-68f7bf27c5cb",
292-
"x-ms-ratelimit-remaining-subscription-reads": "11992",
293-
"x-ms-request-id": "southeastasia:dd23ce59-4dd0-429b-b252-130416a941fb",
294-
"x-ms-routing-request-id": "SOUTHEASTASIA:20220125T100336Z:089933a0-235c-447d-b754-68f7bf27c5cb"
283+
"x-ms-correlation-request-id": "e538c2b6-b968-4d08-98e8-3a08332d1e7b",
284+
"x-ms-ratelimit-remaining-subscription-reads": "11983",
285+
"x-ms-request-id": "southeastasia:fdef5bc5-b437-411d-8c28-5ad757d27b30",
286+
"x-ms-routing-request-id": "SOUTHEASTASIA:20220304T084330Z:e538c2b6-b968-4d08-98e8-3a08332d1e7b"
295287
},
296288
"ResponseBody": {
297289
"properties": {
@@ -310,16 +302,16 @@
310302
"Accept-Encoding": "gzip, deflate",
311303
"Authorization": "Sanitized",
312304
"Connection": "keep-alive",
313-
"User-Agent": "azsdk-python-azure-mgmt-resource/20.0.0 Python/3.8.8 (Windows-10-10.0.19041-SP0)",
314-
"x-ms-client-request-id": "0fbe296d-7dc6-11ec-adf9-70b5e82527ff"
305+
"User-Agent": "azsdk-python-azure-mgmt-resource/20.1.0 Python/3.9.10 (Windows-10-10.0.22000-SP0)",
306+
"x-ms-client-request-id": "32a3d43f-9b97-11ec-868b-d08e79139a4a"
315307
},
316308
"RequestBody": null,
317309
"StatusCode": 200,
318310
"ResponseHeaders": {
319311
"Cache-Control": "no-cache",
320312
"Content-Encoding": "gzip",
321313
"Content-Type": "application/json; charset=utf-8",
322-
"Date": "Tue, 25 Jan 2022 10:03:36 GMT",
314+
"Date": "Fri, 04 Mar 2022 08:43:30 GMT",
323315
"Expires": "-1",
324316
"Pragma": "no-cache",
325317
"Strict-Transport-Security": "max-age=31536000; includeSubDomains",
@@ -329,10 +321,10 @@
329321
"Accept-Encoding"
330322
],
331323
"X-Content-Type-Options": "nosniff",
332-
"x-ms-correlation-request-id": "006f3433-ef98-464d-9907-2cc1bde2f408",
333-
"x-ms-ratelimit-remaining-subscription-reads": "11991",
334-
"x-ms-request-id": "southeastasia:3f1b3094-28bb-4b2b-bf90-98278cb7d8cd",
335-
"x-ms-routing-request-id": "SOUTHEASTASIA:20220125T100337Z:006f3433-ef98-464d-9907-2cc1bde2f408"
324+
"x-ms-correlation-request-id": "d4daf121-cf4d-476a-b37e-a9575451a525",
325+
"x-ms-ratelimit-remaining-subscription-reads": "11982",
326+
"x-ms-request-id": "southeastasia:d4973db8-2bf1-4f20-9734-85344f76ec6c",
327+
"x-ms-routing-request-id": "SOUTHEASTASIA:20220304T084331Z:d4daf121-cf4d-476a-b37e-a9575451a525"
336328
},
337329
"ResponseBody": {
338330
"value": [
@@ -356,23 +348,23 @@
356348
"Authorization": "Sanitized",
357349
"Connection": "keep-alive",
358350
"Content-Length": "0",
359-
"User-Agent": "azsdk-python-azure-mgmt-resource/20.0.0 Python/3.8.8 (Windows-10-10.0.19041-SP0)",
360-
"x-ms-client-request-id": "0fd0baa6-7dc6-11ec-98aa-70b5e82527ff"
351+
"User-Agent": "azsdk-python-azure-mgmt-resource/20.1.0 Python/3.9.10 (Windows-10-10.0.22000-SP0)",
352+
"x-ms-client-request-id": "32b9c850-9b97-11ec-b3b5-d08e79139a4a"
361353
},
362354
"RequestBody": null,
363355
"StatusCode": 200,
364356
"ResponseHeaders": {
365357
"Cache-Control": "no-cache",
366358
"Content-Length": "0",
367-
"Date": "Tue, 25 Jan 2022 10:03:36 GMT",
359+
"Date": "Fri, 04 Mar 2022 08:43:30 GMT",
368360
"Expires": "-1",
369361
"Pragma": "no-cache",
370362
"Strict-Transport-Security": "max-age=31536000; includeSubDomains",
371363
"X-Content-Type-Options": "nosniff",
372-
"x-ms-correlation-request-id": "05fda296-1385-4056-b52f-24fd92ec28a6",
373-
"x-ms-ratelimit-remaining-subscription-deletes": "14994",
374-
"x-ms-request-id": "southeastasia:4e5b43e8-942b-44a2-9123-7c355a7c81d3",
375-
"x-ms-routing-request-id": "SOUTHEASTASIA:20220125T100337Z:05fda296-1385-4056-b52f-24fd92ec28a6"
364+
"x-ms-correlation-request-id": "21bedf8d-b1f9-4383-8549-7e3c385ce77c",
365+
"x-ms-ratelimit-remaining-subscription-deletes": "14992",
366+
"x-ms-request-id": "southeastasia:5c9a7ff6-98cb-4f42-aca4-776a7d8b055e",
367+
"x-ms-routing-request-id": "SOUTHEASTASIA:20220304T084331Z:21bedf8d-b1f9-4383-8549-7e3c385ce77c"
376368
},
377369
"ResponseBody": null
378370
}

0 commit comments

Comments
 (0)