Skip to content

Commit 81cff25

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

File tree

4 files changed

+235
-231
lines changed

4 files changed

+235
-231
lines changed

sdk/search/azure-mgmt-search/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/search/azure-mgmt-search/tests/recordings/test_mgmt_search.pyTestMgmtSearchtest_search_admin_keys.json

Lines changed: 64 additions & 66 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.7.2 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, 30 Nov 2021 05:47:55 GMT",
20+
"Date": "Fri, 04 Mar 2022 09:14:17 GMT",
2121
"P3P": "CP=\u0022DSP CUR OTPi IND OTRi ONL FIN\u0022",
22-
"Set-Cookie": [
23-
"fpc=AoicKnIQ13FCjKBqQ-dV3I7mIjFAAgAAAOOxN9kOAAAA; expires=Thu, 30-Dec-2021 05:47:55 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.12231.8 - WUS2 ProdSlices",
30-
"x-ms-request-id": "55fdeb16-7f94-4aef-927e-9d7a446e8502"
25+
"x-ms-ests-server": "2.1.12507.17 - SCUS ProdSlices",
26+
"x-ms-request-id": "3db8a055-a148-4caa-bb08-0ea0fb8db300"
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=AoicKnIQ13FCjKBqQ-dV3I7mIjFAAgAAAOOxN9kOAAAA; stsservicecookie=estsfd; x-ms-gateway-slice=estsfd",
108-
"User-Agent": "azsdk-python-identity/1.7.2 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, 30 Nov 2021 05:47:55 GMT",
114+
"Date": "Fri, 04 Mar 2022 09:14:17 GMT",
119115
"P3P": "CP=\u0022DSP CUR OTPi IND OTRi ONL FIN\u0022",
120-
"Set-Cookie": [
121-
"fpc=AoicKnIQ13FCjKBqQ-dV3I7mIjFAAgAAAOOxN9kOAAAA; expires=Thu, 30-Dec-2021 05:47:55 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.12249.14 - KRSLR1 ProdSlices",
128-
"x-ms-request-id": "c3233cd9-9248-4127-b0f2-7c6ef9763e00"
119+
"x-ms-ests-server": "2.1.12529.17 - SEASLR2 ProdSlices",
120+
"x-ms-request-id": "9eee5441-91b7-4031-be95-4d3592720d00"
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": "9a3af1e0-2f38-4be5-810c-74b9eace74d3",
175+
"client-request-id": "3746ec75-6530-407a-8f7e-f131f66f17b9",
184176
"Connection": "keep-alive",
185-
"Content-Length": "286",
177+
"Content-Length": "289",
186178
"Content-Type": "application/x-www-form-urlencoded",
187-
"Cookie": "fpc=AoicKnIQ13FCjKBqQ-dV3I7mIjFAAgAAAOOxN9kOAAAA; stsservicecookie=estsfd; x-ms-gateway-slice=estsfd",
188-
"User-Agent": "azsdk-python-identity/1.7.2 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
},
197-
"RequestBody": "client_id=8c41a920-007a-4844-a189-2d0efe39f51e\u0026grant_type=client_credentials\u0026client_info=1\u0026client_secret=o0XWF_siD-FhI.5AE83-u0GaQHW_GP7cjy\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",
189+
"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": "9a3af1e0-2f38-4be5-810c-74b9eace74d3",
202-
"Content-Length": "1349",
193+
"client-request-id": "3746ec75-6530-407a-8f7e-f131f66f17b9",
194+
"Content-Length": "93",
203195
"Content-Type": "application/json; charset=utf-8",
204-
"Date": "Tue, 30 Nov 2021 05:47:55 GMT",
196+
"Date": "Fri, 04 Mar 2022 09:14:18 GMT",
205197
"Expires": "-1",
206198
"P3P": "CP=\u0022DSP CUR OTPi IND OTRi ONL FIN\u0022",
207199
"Pragma": "no-cache",
208-
"Set-Cookie": [
209-
"fpc=AoicKnIQ13FCjKBqQ-dV3I7mIjFAAwAAAOOxN9kOAAAA; expires=Thu, 30-Dec-2021 05:47:55 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.12231.8 - SCUS ProdSlices",
217-
"x-ms-request-id": "f80f3599-936c-48b6-b108-34e266356a02"
204+
"x-ms-ests-server": "2.1.12507.17 - NCUS ProdSlices",
205+
"x-ms-request-id": "b9f81a21-76f7-4b36-96ff-f64e2a048300"
218206
},
219207
"ResponseBody": {
220208
"token_type": "Bearer",
221209
"expires_in": 3599,
222210
"ext_expires_in": 3599,
223-
"access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6Imwzc1EtNTBjQ0g0eEJWWkxIVEd3blNSNzY4MCIsImtpZCI6Imwzc1EtNTBjQ0g0eEJWWkxIVEd3blNSNzY4MCJ9.eyJhdWQiOiJodHRwczovL21hbmFnZW1lbnQuYXp1cmUuY29tIiwiaXNzIjoiaHR0cHM6Ly9zdHMud2luZG93cy5uZXQvNTQ4MjZiMjItMzhkNi00ZmIyLWJhZDktYjdiOTNhM2U5YzVhLyIsImlhdCI6MTYzODI1MDk3NSwibmJmIjoxNjM4MjUwOTc1LCJleHAiOjE2MzgyNTQ4NzUsImFpbyI6IkUyWmdZTWhsTHZaOU1yT1lJMmIycmUrL3hEUGVBQUE9IiwiYXBwaWQiOiI4YzQxYTkyMC0wMDdhLTQ4NDQtYTE4OS0yZDBlZmUzOWY1MWUiLCJhcHBpZGFjciI6IjEiLCJpZHAiOiJodHRwczovL3N0cy53aW5kb3dzLm5ldC81NDgyNmIyMi0zOGQ2LTRmYjItYmFkOS1iN2I5M2EzZTljNWEvIiwib2lkIjoiMjI5YmVmMDAtNjUzNi00YjZhLTgyZDAtZWM4M2JmMWNkYTdlIiwicmgiOiIwLkFUY0FJbXVDVk5ZNHNrLTYyYmU1T2o2Y1dpQ3BRWXg2QUVSSW9Za3REdjQ1OVI0M0FBQS4iLCJzdWIiOiIyMjliZWYwMC02NTM2LTRiNmEtODJkMC1lYzgzYmYxY2RhN2UiLCJ0aWQiOiI1NDgyNmIyMi0zOGQ2LTRmYjItYmFkOS1iN2I5M2EzZTljNWEiLCJ1dGkiOiJtVFVQLUd5VHRraXhDRFRpWmpWcUFnIiwidmVyIjoiMS4wIiwieG1zX3RjZHQiOjE0MTIyMDY4NDB9.l_Ki4vgYUi-BKLPYbDjjDF8u1J8Vr2A6-VxSK7y8j7xOYbaxPMcenSQfAYXTsmykMIL7nKwKqMYTTW0SSwHdwS9VW72S-1A7QlmdxDmpLKAe2sVJ2NVN893RTplYD6YV0M3E1WOIVdHgRSNVaAbqpondoS-JstFvIzdm1H6y8qeT8Yk9NLy2fk8j9AarOwTmLx471qZnJX4I8gngfik8S6e2JixMRLD9qAe1bkjmupHEUIu6R6-mfOfBEGQl3Nnsnpdq_8qduWU6QH3Zf0h5Dk2pEG5_AXhgCFRyYJHmXMOoocIPkI2sA5EBK6nRdgtMLI9KCxSkxlOJOcyuTS9tJw"
211+
"access_token": "access_token"
224212
}
225213
},
226214
{
@@ -233,27 +221,37 @@
233221
"Connection": "keep-alive",
234222
"Content-Length": "129",
235223
"Content-Type": "application/json",
236-
"User-Agent": "azsdk-python-mgmt-search/8.0.0 Python/3.8.8 (Windows-10-10.0.19041-SP0)",
237-
"x-ms-client-request-id": "10bc19ea-51a1-11ec-a808-70b5e82527ff"
224+
"User-Agent": "azsdk-python-mgmt-search/8.0.0 Python/3.9.10 (Windows-10-10.0.22000-SP0)",
225+
"x-ms-client-request-id": "7f4c2550-9b9b-11ec-bbeb-d08e79139a4a"
226+
},
227+
"RequestBody": {
228+
"location": "westus",
229+
"sku": {
230+
"name": "free"
231+
},
232+
"properties": {
233+
"replicaCount": 1,
234+
"partitionCount": 1,
235+
"hostingMode": "Default"
236+
}
238237
},
239-
"RequestBody": "{\u0022location\u0022: \u0022westus\u0022, \u0022sku\u0022: {\u0022name\u0022: \u0022free\u0022}, \u0022properties\u0022: {\u0022replicaCount\u0022: 1, \u0022partitionCount\u0022: 1, \u0022hostingMode\u0022: \u0022Default\u0022}}",
240238
"StatusCode": 201,
241239
"ResponseHeaders": {
242240
"Cache-Control": "no-cache",
243241
"Content-Length": "544",
244242
"Content-Type": "application/json; charset=utf-8",
245-
"Date": "Tue, 30 Nov 2021 05:47:58 GMT",
246-
"elapsed-time": "1327",
247-
"ETag": "W/\u0022datetime\u00272021-11-30T05%3A47%3A58.1722939Z\u0027\u0022",
243+
"Date": "Fri, 04 Mar 2022 09:14:21 GMT",
244+
"elapsed-time": "1174",
245+
"ETag": "W/\u0022datetime\u00272022-03-04T09%3A14%3A20.9111901Z\u0027\u0022",
248246
"Expires": "-1",
249247
"Pragma": "no-cache",
250-
"request-id": "10bc19ea-51a1-11ec-a808-70b5e82527ff",
248+
"request-id": "7f4c2550-9b9b-11ec-bbeb-d08e79139a4a",
251249
"Strict-Transport-Security": "max-age=31536000; includeSubDomains",
252250
"X-Content-Type-Options": "nosniff",
253-
"x-ms-correlation-request-id": "a14ba9dd-58c2-4096-ae43-4ea776bd65d6",
251+
"x-ms-correlation-request-id": "e4c4e347-fc1d-49a1-a96f-c3cde922c687",
254252
"x-ms-ratelimit-remaining-subscription-writes": "1197",
255-
"x-ms-request-id": "10bc19ea-51a1-11ec-a808-70b5e82527ff",
256-
"x-ms-routing-request-id": "JAPANEAST:20211130T054759Z:a14ba9dd-58c2-4096-ae43-4ea776bd65d6"
253+
"x-ms-request-id": "7f4c2550-9b9b-11ec-bbeb-d08e79139a4a",
254+
"x-ms-routing-request-id": "SOUTHEASTASIA:20220304T091422Z:e4c4e347-fc1d-49a1-a96f-c3cde922c687"
257255
},
258256
"ResponseBody": {
259257
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/c44826ac/providers/Microsoft.Search/searchServices/ptvstestquerykeys",
@@ -289,35 +287,35 @@
289287
"Authorization": "Sanitized",
290288
"Connection": "keep-alive",
291289
"Content-Length": "0",
292-
"User-Agent": "azsdk-python-mgmt-search/8.0.0 Python/3.8.8 (Windows-10-10.0.19041-SP0)",
293-
"x-ms-client-request-id": "130649b5-51a1-11ec-9383-70b5e82527ff"
290+
"User-Agent": "azsdk-python-mgmt-search/8.0.0 Python/3.9.10 (Windows-10-10.0.22000-SP0)",
291+
"x-ms-client-request-id": "820d6cac-9b9b-11ec-a3f6-d08e79139a4a"
294292
},
295293
"RequestBody": null,
296294
"StatusCode": 200,
297295
"ResponseHeaders": {
298296
"Cache-Control": "no-cache",
299297
"Content-Encoding": "gzip",
300298
"Content-Type": "application/json; charset=utf-8",
301-
"Date": "Tue, 30 Nov 2021 05:47:59 GMT",
302-
"elapsed-time": "113",
299+
"Date": "Fri, 04 Mar 2022 09:14:21 GMT",
300+
"elapsed-time": "145",
303301
"Expires": "-1",
304302
"Pragma": "no-cache",
305-
"request-id": "130649b5-51a1-11ec-9383-70b5e82527ff",
303+
"request-id": "820d6cac-9b9b-11ec-a3f6-d08e79139a4a",
306304
"Strict-Transport-Security": "max-age=31536000; includeSubDomains",
307305
"Transfer-Encoding": "chunked",
308306
"Vary": [
309307
"Accept-Encoding",
310308
"Accept-Encoding"
311309
],
312310
"X-Content-Type-Options": "nosniff",
313-
"x-ms-correlation-request-id": "4f94e6ac-d6d3-4e5f-8d30-4502fb8e20e1",
311+
"x-ms-correlation-request-id": "f0ff53a1-d820-449b-8802-93e12c0425ce",
314312
"x-ms-ratelimit-remaining-subscription-writes": "1195",
315-
"x-ms-request-id": "130649b5-51a1-11ec-9383-70b5e82527ff",
316-
"x-ms-routing-request-id": "JAPANEAST:20211130T054759Z:4f94e6ac-d6d3-4e5f-8d30-4502fb8e20e1"
313+
"x-ms-request-id": "820d6cac-9b9b-11ec-a3f6-d08e79139a4a",
314+
"x-ms-routing-request-id": "SOUTHEASTASIA:20220304T091422Z:f0ff53a1-d820-449b-8802-93e12c0425ce"
317315
},
318316
"ResponseBody": {
319-
"primaryKey": "8A97CCA1A15F40215C906BCC4CA4197C",
320-
"secondaryKey": "EA19DA5D7C1FBCEAD0FAEEE46F9E9AA8"
317+
"primaryKey": "D33A96B194A6E73191375E909765374A",
318+
"secondaryKey": "A4F6ABD370AFF3DBCD8ADF79ACE0476B"
321319
}
322320
},
323321
{
@@ -329,35 +327,35 @@
329327
"Authorization": "Sanitized",
330328
"Connection": "keep-alive",
331329
"Content-Length": "0",
332-
"User-Agent": "azsdk-python-mgmt-search/8.0.0 Python/3.8.8 (Windows-10-10.0.19041-SP0)",
333-
"x-ms-client-request-id": "134036d6-51a1-11ec-8af5-70b5e82527ff"
330+
"User-Agent": "azsdk-python-mgmt-search/8.0.0 Python/3.9.10 (Windows-10-10.0.22000-SP0)",
331+
"x-ms-client-request-id": "82511f31-9b9b-11ec-9e13-d08e79139a4a"
334332
},
335333
"RequestBody": null,
336334
"StatusCode": 200,
337335
"ResponseHeaders": {
338336
"Cache-Control": "no-cache",
339337
"Content-Encoding": "gzip",
340338
"Content-Type": "application/json; charset=utf-8",
341-
"Date": "Tue, 30 Nov 2021 05:47:59 GMT",
342-
"elapsed-time": "257",
339+
"Date": "Fri, 04 Mar 2022 09:14:22 GMT",
340+
"elapsed-time": "319",
343341
"Expires": "-1",
344342
"Pragma": "no-cache",
345-
"request-id": "134036d6-51a1-11ec-8af5-70b5e82527ff",
343+
"request-id": "82511f31-9b9b-11ec-9e13-d08e79139a4a",
346344
"Strict-Transport-Security": "max-age=31536000; includeSubDomains",
347345
"Transfer-Encoding": "chunked",
348346
"Vary": [
349347
"Accept-Encoding",
350348
"Accept-Encoding"
351349
],
352350
"X-Content-Type-Options": "nosniff",
353-
"x-ms-correlation-request-id": "99ff91fe-2db9-4f57-abbd-995cc56ca017",
351+
"x-ms-correlation-request-id": "f3f894f1-6b2c-46f5-adbd-49e307b6c979",
354352
"x-ms-ratelimit-remaining-subscription-writes": "1194",
355-
"x-ms-request-id": "134036d6-51a1-11ec-8af5-70b5e82527ff",
356-
"x-ms-routing-request-id": "JAPANEAST:20211130T054759Z:99ff91fe-2db9-4f57-abbd-995cc56ca017"
353+
"x-ms-request-id": "82511f31-9b9b-11ec-9e13-d08e79139a4a",
354+
"x-ms-routing-request-id": "SOUTHEASTASIA:20220304T091423Z:f3f894f1-6b2c-46f5-adbd-49e307b6c979"
357355
},
358356
"ResponseBody": {
359-
"primaryKey": "65D902C9E5558538B6278F7D7A532496",
360-
"secondaryKey": "EA19DA5D7C1FBCEAD0FAEEE46F9E9AA8"
357+
"primaryKey": "ADD2F891CBCA2DDAC90DE27FBA9C9572",
358+
"secondaryKey": "A4F6ABD370AFF3DBCD8ADF79ACE0476B"
361359
}
362360
}
363361
],

0 commit comments

Comments
 (0)