Skip to content

Commit 7339b70

Browse files
[Storage] Migrate test_file.py to test proxy (file-share) (Azure#26658)
* Initial commit, 4 remaining fail (sync,live) * Adjust request digging tests to live only * sync done live&recorded finally * Forgot to save when resolving merge conflict * Fixed sync naming, migrated async, adjusted test case to make it easy to abort in live * Delete empty recording files, refactor imports
1 parent 5bba523 commit 7339b70

File tree

367 files changed

+31495
-68441
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

367 files changed

+31495
-68441
lines changed

sdk/storage/azure-storage-file-datalake/conftest.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ def add_sanitizers(test_proxy):
3232
add_header_regex_sanitizer(key="Cookie", value="cookie;")
3333
add_oauth_response_sanitizer()
3434

35+
add_header_regex_sanitizer(key="x-ms-copy-source-authorization", value="Sanitized")
3536
add_header_regex_sanitizer(key="x-ms-encryption-key", value="Sanitized")
3637

3738
add_uri_string_sanitizer(target=".preprod.", value=".")

sdk/storage/azure-storage-file-share/tests/conftest.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ def add_sanitizers(test_proxy):
2727
add_header_regex_sanitizer(key="Cookie", value="cookie;")
2828
add_oauth_response_sanitizer()
2929

30+
add_header_regex_sanitizer(key="x-ms-copy-source-authorization", value="Sanitized")
3031
add_header_regex_sanitizer(key="x-ms-encryption-key", value="Sanitized")
3132

3233
add_uri_string_sanitizer(target=".preprod.", value=".")

sdk/storage/azure-storage-file-share/tests/recordings/test_file.pyTestStorageFiletest_abort_copy_file.json

Lines changed: 265 additions & 0 deletions
Large diffs are not rendered by default.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,168 @@
1+
{
2+
"Entries": [
3+
{
4+
"RequestUri": "https://storagename.file.core.windows.net/utsharebe7c325a?restype=share",
5+
"RequestMethod": "PUT",
6+
"RequestHeaders": {
7+
"Accept": "application/xml",
8+
"Accept-Encoding": "gzip, deflate",
9+
"Connection": "keep-alive",
10+
"Content-Length": "0",
11+
"User-Agent": "azsdk-python-storage-file-share/12.10.0 Python/3.10.2 (Windows-10-10.0.19044-SP0)",
12+
"x-ms-date": "Wed, 05 Oct 2022 22:14:45 GMT",
13+
"x-ms-version": "2021-06-08"
14+
},
15+
"RequestBody": null,
16+
"StatusCode": 201,
17+
"ResponseHeaders": {
18+
"Content-Length": "0",
19+
"Date": "Wed, 05 Oct 2022 22:14:46 GMT",
20+
"ETag": "\u00220x8DAA71F031B0F45\u0022",
21+
"Last-Modified": "Wed, 05 Oct 2022 22:14:46 GMT",
22+
"Server": [
23+
"Windows-Azure-File/1.0",
24+
"Microsoft-HTTPAPI/2.0"
25+
],
26+
"x-ms-version": "2021-06-08"
27+
},
28+
"ResponseBody": null
29+
},
30+
{
31+
"RequestUri": "https://storagename.file.core.windows.net/utsharebe7c325a/filebe7c325a",
32+
"RequestMethod": "PUT",
33+
"RequestHeaders": {
34+
"Accept": "application/xml",
35+
"Accept-Encoding": "gzip, deflate",
36+
"Connection": "keep-alive",
37+
"Content-Length": "0",
38+
"User-Agent": "azsdk-python-storage-file-share/12.10.0 Python/3.10.2 (Windows-10-10.0.19044-SP0)",
39+
"x-ms-content-length": "1024",
40+
"x-ms-date": "Wed, 05 Oct 2022 22:14:46 GMT",
41+
"x-ms-file-attributes": "none",
42+
"x-ms-file-creation-time": "now",
43+
"x-ms-file-last-write-time": "now",
44+
"x-ms-file-permission": "Inherit",
45+
"x-ms-type": "file",
46+
"x-ms-version": "2021-06-08"
47+
},
48+
"RequestBody": null,
49+
"StatusCode": 201,
50+
"ResponseHeaders": {
51+
"Content-Length": "0",
52+
"Date": "Wed, 05 Oct 2022 22:14:46 GMT",
53+
"ETag": "\u00220x8DAA71F032D1768\u0022",
54+
"Last-Modified": "Wed, 05 Oct 2022 22:14:46 GMT",
55+
"Server": [
56+
"Windows-Azure-File/1.0",
57+
"Microsoft-HTTPAPI/2.0"
58+
],
59+
"x-ms-file-attributes": "Archive",
60+
"x-ms-file-change-time": "2022-10-05T22:14:46.5458024Z",
61+
"x-ms-file-creation-time": "2022-10-05T22:14:46.5458024Z",
62+
"x-ms-file-id": "13835128424026341376",
63+
"x-ms-file-last-write-time": "2022-10-05T22:14:46.5458024Z",
64+
"x-ms-file-parent-id": "0",
65+
"x-ms-file-permission-key": "3254952746172754359*9622787259914961209",
66+
"x-ms-request-server-encrypted": "true",
67+
"x-ms-version": "2021-06-08"
68+
},
69+
"ResponseBody": null
70+
},
71+
{
72+
"RequestUri": "https://storagename.file.core.windows.net/utsharebe7c325a/filebe7c325a?comp=range",
73+
"RequestMethod": "PUT",
74+
"RequestHeaders": {
75+
"Accept": "application/xml",
76+
"Accept-Encoding": "gzip, deflate",
77+
"Connection": "keep-alive",
78+
"Content-Length": "1024",
79+
"Content-Type": "application/octet-stream",
80+
"User-Agent": "azsdk-python-storage-file-share/12.10.0 Python/3.10.2 (Windows-10-10.0.19044-SP0)",
81+
"x-ms-date": "Wed, 05 Oct 2022 22:14:46 GMT",
82+
"x-ms-range": "bytes=0-1023",
83+
"x-ms-version": "2021-06-08",
84+
"x-ms-write": "update"
85+
},
86+
"RequestBody": "YWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFh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91+
"Date": "Wed, 05 Oct 2022 22:14:46 GMT",
92+
"ETag": "\u00220x8DAA71F033E52F2\u0022",
93+
"Last-Modified": "Wed, 05 Oct 2022 22:14:46 GMT",
94+
"Server": [
95+
"Windows-Azure-File/1.0",
96+
"Microsoft-HTTPAPI/2.0"
97+
],
98+
"x-ms-file-last-write-time": "2022-10-05T22:14:46.6587378Z",
99+
"x-ms-request-server-encrypted": "true",
100+
"x-ms-version": "2021-06-08"
101+
},
102+
"ResponseBody": null
103+
},
104+
{
105+
"RequestUri": "https://storagename.file.core.windows.net/utsharebe7c325a/targetfile",
106+
"RequestMethod": "PUT",
107+
"RequestHeaders": {
108+
"Accept": "application/xml",
109+
"Accept-Encoding": "gzip, deflate",
110+
"Connection": "keep-alive",
111+
"Content-Length": "0",
112+
"User-Agent": "azsdk-python-storage-file-share/12.10.0 Python/3.10.2 (Windows-10-10.0.19044-SP0)",
113+
"x-ms-copy-source": "https://storagename.file.core.windows.net/utsharebe7c325a/filebe7c325a",
114+
"x-ms-date": "Wed, 05 Oct 2022 22:14:46 GMT",
115+
"x-ms-version": "2021-06-08"
116+
},
117+
"RequestBody": null,
118+
"StatusCode": 202,
119+
"ResponseHeaders": {
120+
"Content-Length": "0",
121+
"Date": "Wed, 05 Oct 2022 22:14:46 GMT",
122+
"ETag": "\u00220x8DAA71F0369F070\u0022",
123+
"Last-Modified": "Wed, 05 Oct 2022 22:14:46 GMT",
124+
"Server": [
125+
"Windows-Azure-File/1.0",
126+
"Microsoft-HTTPAPI/2.0"
127+
],
128+
"x-ms-copy-id": "c1ae6fca-33ea-49c1-81c8-90f1c89972d0",
129+
"x-ms-copy-status": "success",
130+
"x-ms-version": "2021-06-08"
131+
},
132+
"ResponseBody": null
133+
},
134+
{
135+
"RequestUri": "https://storagename.file.core.windows.net/utsharebe7c325a/targetfile?comp=copy\u0026copyid=c1ae6fca-33ea-49c1-81c8-90f1c89972d0",
136+
"RequestMethod": "PUT",
137+
"RequestHeaders": {
138+
"Accept": "application/xml",
139+
"Accept-Encoding": "gzip, deflate",
140+
"Connection": "keep-alive",
141+
"Content-Length": "0",
142+
"User-Agent": "azsdk-python-storage-file-share/12.10.0 Python/3.10.2 (Windows-10-10.0.19044-SP0)",
143+
"x-ms-copy-action": "abort",
144+
"x-ms-date": "Wed, 05 Oct 2022 22:14:46 GMT",
145+
"x-ms-version": "2021-06-08"
146+
},
147+
"RequestBody": null,
148+
"StatusCode": 409,
149+
"ResponseHeaders": {
150+
"Content-Length": "236",
151+
"Content-Type": "application/xml",
152+
"Date": "Wed, 05 Oct 2022 22:14:47 GMT",
153+
"Server": [
154+
"Windows-Azure-File/1.0",
155+
"Microsoft-HTTPAPI/2.0"
156+
],
157+
"x-ms-error-code": "NoPendingCopyOperation",
158+
"x-ms-version": "2021-06-08"
159+
},
160+
"ResponseBody": [
161+
"\uFEFF\u003C?xml version=\u00221.0\u0022 encoding=\u0022utf-8\u0022?\u003E\u003CError\u003E\u003CCode\u003ENoPendingCopyOperation\u003C/Code\u003E\u003CMessage\u003EThere is currently no pending copy operation.\n",
162+
"RequestId:ba60a967-b01a-003c-1f07-d96467000000\n",
163+
"Time:2022-10-05T22:14:47.0862532Z\u003C/Message\u003E\u003C/Error\u003E"
164+
]
165+
}
166+
],
167+
"Variables": {}
168+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
1+
{
2+
"Entries": [
3+
{
4+
"RequestUri": "https://storagename.file.core.windows.net/utsharee0c02969?restype=share",
5+
"RequestMethod": "PUT",
6+
"RequestHeaders": {
7+
"Accept": "application/xml",
8+
"Accept-Encoding": "gzip, deflate",
9+
"Connection": "keep-alive",
10+
"Content-Length": "0",
11+
"User-Agent": "azsdk-python-storage-file-share/12.10.0 Python/3.10.2 (Windows-10-10.0.19044-SP0)",
12+
"x-ms-date": "Wed, 05 Oct 2022 22:15:41 GMT",
13+
"x-ms-version": "2021-06-08"
14+
},
15+
"RequestBody": null,
16+
"StatusCode": 201,
17+
"ResponseHeaders": {
18+
"Content-Length": "0",
19+
"Date": "Wed, 05 Oct 2022 22:15:41 GMT",
20+
"ETag": "\u00220x8DAA71F244256D6\u0022",
21+
"Last-Modified": "Wed, 05 Oct 2022 22:15:42 GMT",
22+
"Server": [
23+
"Windows-Azure-File/1.0",
24+
"Microsoft-HTTPAPI/2.0"
25+
],
26+
"x-ms-version": "2021-06-08"
27+
},
28+
"ResponseBody": null
29+
},
30+
{
31+
"RequestUri": "https://storagename.file.core.windows.net/utsharee0c02969/filee0c02969",
32+
"RequestMethod": "PUT",
33+
"RequestHeaders": {
34+
"Accept": "application/xml",
35+
"Accept-Encoding": "gzip, deflate",
36+
"Connection": "keep-alive",
37+
"Content-Length": "0",
38+
"User-Agent": "azsdk-python-storage-file-share/12.10.0 Python/3.10.2 (Windows-10-10.0.19044-SP0)",
39+
"x-ms-content-length": "1024",
40+
"x-ms-date": "Wed, 05 Oct 2022 22:15:41 GMT",
41+
"x-ms-file-attributes": "none",
42+
"x-ms-file-creation-time": "now",
43+
"x-ms-file-last-write-time": "now",
44+
"x-ms-file-permission": "Inherit",
45+
"x-ms-type": "file",
46+
"x-ms-version": "2021-06-08"
47+
},
48+
"RequestBody": null,
49+
"StatusCode": 201,
50+
"ResponseHeaders": {
51+
"Content-Length": "0",
52+
"Date": "Wed, 05 Oct 2022 22:15:42 GMT",
53+
"ETag": "\u00220x8DAA71F24523A83\u0022",
54+
"Last-Modified": "Wed, 05 Oct 2022 22:15:42 GMT",
55+
"Server": [
56+
"Windows-Azure-File/1.0",
57+
"Microsoft-HTTPAPI/2.0"
58+
],
59+
"x-ms-file-attributes": "Archive",
60+
"x-ms-file-change-time": "2022-10-05T22:15:42.1539971Z",
61+
"x-ms-file-creation-time": "2022-10-05T22:15:42.1539971Z",
62+
"x-ms-file-id": "13835128424026341376",
63+
"x-ms-file-last-write-time": "2022-10-05T22:15:42.1539971Z",
64+
"x-ms-file-parent-id": "0",
65+
"x-ms-file-permission-key": "3254952746172754359*9622787259914961209",
66+
"x-ms-request-server-encrypted": "true",
67+
"x-ms-version": "2021-06-08"
68+
},
69+
"ResponseBody": null
70+
},
71+
{
72+
"RequestUri": "https://storagename.file.core.windows.net/utsharee0c02969/filee0c02969?comp=range",
73+
"RequestMethod": "PUT",
74+
"RequestHeaders": {
75+
"Accept": "application/xml",
76+
"Accept-Encoding": "gzip, deflate",
77+
"Connection": "keep-alive",
78+
"Content-Length": "1024",
79+
"Content-Type": "application/octet-stream",
80+
"User-Agent": "azsdk-python-storage-file-share/12.10.0 Python/3.10.2 (Windows-10-10.0.19044-SP0)",
81+
"x-ms-date": "Wed, 05 Oct 2022 22:15:41 GMT",
82+
"x-ms-range": "bytes=0-1023",
83+
"x-ms-version": "2021-06-08",
84+
"x-ms-write": "update"
85+
},
86+
"RequestBody": "YWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYQ==",
87+
"StatusCode": 201,
88+
"ResponseHeaders": {
89+
"Content-Length": "0",
90+
"Content-MD5": "yaNM/IXZgmmMasifdgcavQ==",
91+
"Date": "Wed, 05 Oct 2022 22:15:42 GMT",
92+
"ETag": "\u00220x8DAA71F2462B2D6\u0022",
93+
"Last-Modified": "Wed, 05 Oct 2022 22:15:42 GMT",
94+
"Server": [
95+
"Windows-Azure-File/1.0",
96+
"Microsoft-HTTPAPI/2.0"
97+
],
98+
"x-ms-file-last-write-time": "2022-10-05T22:15:42.2619350Z",
99+
"x-ms-request-server-encrypted": "true",
100+
"x-ms-version": "2021-06-08"
101+
},
102+
"ResponseBody": null
103+
},
104+
{
105+
"RequestUri": "https://storagename.file.core.windows.net/utsharee0c02969/filee0c02969?se=end\u0026sp=r\u0026sv=2021-06-08\u0026ss=f\u0026srt=o\u0026sig=fake_token_value",
106+
"RequestMethod": "HEAD",
107+
"RequestHeaders": {
108+
"Accept": "application/xml",
109+
"Accept-Encoding": "gzip, deflate",
110+
"Connection": "keep-alive",
111+
"User-Agent": "azsdk-python-storage-file-share/12.10.0 Python/3.10.2 (Windows-10-10.0.19044-SP0)",
112+
"x-ms-date": "Wed, 05 Oct 2022 22:15:42 GMT",
113+
"x-ms-version": "2021-06-08"
114+
},
115+
"RequestBody": null,
116+
"StatusCode": 200,
117+
"ResponseHeaders": {
118+
"Content-Length": "1024",
119+
"Content-Type": "application/octet-stream",
120+
"Date": "Wed, 05 Oct 2022 22:15:42 GMT",
121+
"ETag": "\u00220x8DAA71F2462B2D6\u0022",
122+
"Last-Modified": "Wed, 05 Oct 2022 22:15:42 GMT",
123+
"Server": [
124+
"Windows-Azure-File/1.0",
125+
"Microsoft-HTTPAPI/2.0"
126+
],
127+
"x-ms-file-attributes": "Archive",
128+
"x-ms-file-change-time": "2022-10-05T22:15:42.2619350Z",
129+
"x-ms-file-creation-time": "2022-10-05T22:15:42.1539971Z",
130+
"x-ms-file-id": "13835128424026341376",
131+
"x-ms-file-last-write-time": "2022-10-05T22:15:42.2619350Z",
132+
"x-ms-file-parent-id": "0",
133+
"x-ms-file-permission-key": "3254952746172754359*9622787259914961209",
134+
"x-ms-lease-state": "available",
135+
"x-ms-lease-status": "unlocked",
136+
"x-ms-server-encrypted": "true",
137+
"x-ms-type": "File",
138+
"x-ms-version": "2021-06-08"
139+
},
140+
"ResponseBody": null
141+
}
142+
],
143+
"Variables": {}
144+
}

0 commit comments

Comments
 (0)