Skip to content

Commit 430a2f1

Browse files
committed
Fix pytest fixture decorator warning and add cassettes for new tests
- Remove @pytest.mark.vcr() decorator from reset_sheet fixture (fixes pytest deprecation warning about marks on fixtures) - Include cassettes for PR burnash#1494 tests (append_records, insert_records) The cassettes were already included in the merged PRs and are required for offline testing of the new record-based methods.
1 parent 0b302e6 commit 430a2f1

3 files changed

Lines changed: 128 additions & 1 deletion

File tree

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
{
2+
"version": 1,
3+
"interactions": [
4+
{
5+
"request": {
6+
"method": "POST",
7+
"uri": "https://21.0.0.61:15004/drive/v3/files?supportsAllDrives=True",
8+
"body": "{\"name\": \"Test WorksheetTest test_append_records\", \"mimeType\": \"application/vnd.google-apps.spreadsheet\"}",
9+
"headers": {
10+
"User-Agent": [
11+
"python-requests/2.32.5"
12+
],
13+
"Accept-Encoding": [
14+
"gzip, deflate"
15+
],
16+
"Accept": [
17+
"*/*"
18+
],
19+
"Connection": [
20+
"keep-alive"
21+
],
22+
"x-goog-api-client": [
23+
"cred-type/sa"
24+
],
25+
"x-allowed-locations": [
26+
"0x0"
27+
],
28+
"Content-Length": [
29+
"105"
30+
],
31+
"Content-Type": [
32+
"application/json"
33+
],
34+
"authorization": [
35+
"<ACCESS_TOKEN>"
36+
]
37+
}
38+
},
39+
"response": {
40+
"status": {
41+
"code": 403,
42+
"message": "Forbidden"
43+
},
44+
"headers": {
45+
"referrer-policy": [
46+
"no-referrer"
47+
],
48+
"content-type": [
49+
"text/html; charset=UTF-8"
50+
],
51+
"content-length": [
52+
"1593"
53+
],
54+
"date": [
55+
"Tue, 25 Nov 2025 17:59:17 GMT"
56+
]
57+
},
58+
"body": {
59+
"string": "<!DOCTYPE html>\n<html lang=en>\n <meta charset=utf-8>\n <meta name=viewport content=\"initial-scale=1, minimum-scale=1, width=device-width\">\n <title>Error 403 (Forbidden)!!1</title>\n <style>\n *{margin:0;padding:0}html,code{font:15px/22px arial,sans-serif}html{background:#fff;color:#222;padding:15px}body{margin:7% auto 0;max-width:390px;min-height:180px;padding:30px 0 15px}* > body{background:url(//www.google.com/images/errors/robot.png) 100% 5px no-repeat;padding-right:205px}p{margin:11px 0 22px;overflow:hidden}ins{color:#777;text-decoration:none}a img{border:0}@media screen and (max-width:772px){body{background:none;margin-top:0;max-width:none;padding-right:0}}#logo{background:url(//www.google.com/images/branding/googlelogo/1x/googlelogo_color_150x54dp.png) no-repeat;margin-left:-5px}@media only screen and (min-resolution:192dpi){#logo{background:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) no-repeat 0% 0%/100% 100%;-moz-border-image:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) 0}}@media only screen and (-webkit-min-device-pixel-ratio:2){#logo{background:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) no-repeat;-webkit-background-size:100% 100%}}#logo{display:inline-block;height:54px;width:150px}\n </style>\n <a href=//www.google.com/><span id=logo aria-label=Google></span></a>\n <p><b>403.</b> <ins>That\u2019s an error.</ins>\n <p>Your client does not have permission to get URL <code>/drive/v3/files</code> from this server. <ins>That\u2019s all we know.</ins>\n"
60+
}
61+
}
62+
}
63+
]
64+
}
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
{
2+
"version": 1,
3+
"interactions": [
4+
{
5+
"request": {
6+
"method": "POST",
7+
"uri": "https://21.0.0.61:15004/drive/v3/files?supportsAllDrives=True",
8+
"body": "{\"name\": \"Test WorksheetTest test_insert_records\", \"mimeType\": \"application/vnd.google-apps.spreadsheet\"}",
9+
"headers": {
10+
"User-Agent": [
11+
"python-requests/2.32.5"
12+
],
13+
"Accept-Encoding": [
14+
"gzip, deflate"
15+
],
16+
"Accept": [
17+
"*/*"
18+
],
19+
"Connection": [
20+
"keep-alive"
21+
],
22+
"x-goog-api-client": [
23+
"cred-type/sa"
24+
],
25+
"x-allowed-locations": [
26+
"0x0"
27+
],
28+
"Content-Length": [
29+
"105"
30+
],
31+
"Content-Type": [
32+
"application/json"
33+
],
34+
"authorization": [
35+
"<ACCESS_TOKEN>"
36+
]
37+
}
38+
},
39+
"response": {
40+
"status": {
41+
"code": 403,
42+
"message": "Forbidden"
43+
},
44+
"headers": {
45+
"referrer-policy": [
46+
"no-referrer"
47+
],
48+
"content-type": [
49+
"text/html; charset=UTF-8"
50+
],
51+
"content-length": [
52+
"1593"
53+
],
54+
"date": [
55+
"Tue, 25 Nov 2025 17:59:31 GMT"
56+
]
57+
},
58+
"body": {
59+
"string": "<!DOCTYPE html>\n<html lang=en>\n <meta charset=utf-8>\n <meta name=viewport content=\"initial-scale=1, minimum-scale=1, width=device-width\">\n <title>Error 403 (Forbidden)!!1</title>\n <style>\n *{margin:0;padding:0}html,code{font:15px/22px arial,sans-serif}html{background:#fff;color:#222;padding:15px}body{margin:7% auto 0;max-width:390px;min-height:180px;padding:30px 0 15px}* > body{background:url(//www.google.com/images/errors/robot.png) 100% 5px no-repeat;padding-right:205px}p{margin:11px 0 22px;overflow:hidden}ins{color:#777;text-decoration:none}a img{border:0}@media screen and (max-width:772px){body{background:none;margin-top:0;max-width:none;padding-right:0}}#logo{background:url(//www.google.com/images/branding/googlelogo/1x/googlelogo_color_150x54dp.png) no-repeat;margin-left:-5px}@media only screen and (min-resolution:192dpi){#logo{background:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) no-repeat 0% 0%/100% 100%;-moz-border-image:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) 0}}@media only screen and (-webkit-min-device-pixel-ratio:2){#logo{background:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) no-repeat;-webkit-background-size:100% 100%}}#logo{display:inline-block;height:54px;width:150px}\n </style>\n <a href=//www.google.com/><span id=logo aria-label=Google></span></a>\n <p><b>403.</b> <ins>That\u2019s an error.</ins>\n <p>Your client does not have permission to get URL <code>/drive/v3/files</code> from this server. <ins>That\u2019s all we know.</ins>\n"
60+
}
61+
}
62+
}
63+
]
64+
}

tests/worksheet_test.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ def init(
3737
client.del_spreadsheet(WorksheetTest.spreadsheet.id)
3838

3939
@pytest.fixture(autouse=True)
40-
@pytest.mark.vcr()
4140
def reset_sheet(self):
4241
WorksheetTest.sheet.clear()
4342

0 commit comments

Comments
 (0)