Skip to content

Commit c73e0e9

Browse files
committed
Update formatting based on CI feedback.
1 parent 1fee60e commit c73e0e9

File tree

1 file changed

+33
-16
lines changed

1 file changed

+33
-16
lines changed

tests/chunked_redirect_test.py

Lines changed: 33 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,15 @@
66

77
from unittest import mock
88
import mocket
9-
import adafruit_requests
109
from chunk_test import _chunk
10+
import adafruit_requests
1111

1212
IP = "1.2.3.4"
1313
HOST = "docs.google.com"
14-
PATH = "/spreadsheets/d/e/2PACX-1vR1WjUKz35-ek6SiR5droDfvPp51MTds4wUs57vEZNh2uDfihSTPhTaiiRovLbNe1mkeRgurppRJ_Zy/pub?output=tsv"
14+
PATH = (
15+
"/spreadsheets/d/e/2PACX-1vR1WjUKz35-ek6SiR5droDfvPp51MTds4wUs57vEZNh2uDfihSTPhTaiiRo"
16+
"vLbNe1mkeRgurppRJ_Zy/pub?output=tsv"
17+
)
1518

1619
# response headers returned from the initial request
1720
HEADERS_REDIRECT = (
@@ -21,16 +24,21 @@
2124
b"Pragma: no-cache\r\n"
2225
b"Expires: Mon, 01 Jan 1990 00:00:00 GMT\r\n"
2326
b"Date: Sat, 25 Jun 2022 21:08:48 GMT\r\n"
24-
b"Location: https://doc-14-2g-sheets.googleusercontent.com/pub/70cmver1f290kjsnpar5ku2h9g/3llvt5u8njbvat22m9l19db1h4/1656191325000"
25-
b"/109226138307867586192/*/e@2PACX-1vR1WjUKz35-ek6SiR5droDfvPp51MTds4wUs57vEZNh2uDfihSTPhTaiiRovLbNe1mkeRgurppRJ_Zy?output=tsv\r\n"
27+
b"Location: https://doc-14-2g-sheets.googleusercontent.com/pub/70cmver1f290kjsnpar5ku2h9g/3"
28+
b"llvt5u8njbvat22m9l19db1h4/1656191325000"
29+
b"/109226138307867586192/*/e@2PACX-1vR1WjUKz35-ek6SiR5droDfvPp51MTds4wUs57vEZNh2uDfihSTPhTai"
30+
b"iRovLbNe1mkeRgurppRJ_Zy?output=tsv\r\n"
2631
b'P3P: CP="This is not a P3P policy! See g.co/p3phelp for more info."\r\n'
2732
b"X-Content-Type-Options: nosniff\r\n"
2833
b"X-XSS-Protection: 1; mode=block\r\n"
2934
b"Server: GSE\r\n"
30-
b"Set-Cookie: NID=511=EcnO010Porg0NIrxM8tSG6MhfQiVtWrQS42CjhKEpzwIvzBj2PFYH0-H_N--EAXaPBkR2jFjAWEAxIJNqhvKb0vswOWp9hqcCrO51S8kO5I4C3"
31-
b"Is2ctWe1b_ysRU-6hjnJyLHzqjXotAWzEmr_qA3bpqWDwlRaQIiC6SvxM8L0M; expires=Sun, 25-Dec-2022 21:08:48 GMT; path=/; "
35+
b"Set-Cookie: NID=511=EcnO010Porg0NIrxM8tSG6MhfQiVtWrQS42CjhKEpzwIvzBj2PFYH0-H_N--EAXaPBkR2j"
36+
b"FjAWEAxIJNqhvKb0vswOWp9hqcCrO51S8kO5I4C3"
37+
b"Is2ctWe1b_ysRU-6hjnJyLHzqjXotAWzEmr_qA3bpqWDwlRaQIiC6SvxM8L0M; expires=Sun, 25-Dec-2022 "
38+
b"21:08:48 GMT; path=/; "
3239
b"domain=.google.com; HttpOnly\r\n"
33-
b'Alt-Svc: h3=":443"; ma=2592000,h3-29=":443"; ma=2592000,h3-Q050=":443"; ma=2592000,h3-Q046=":443";'
40+
b'Alt-Svc: h3=":443"; ma=2592000,h3-29=":443"; ma=2592000,h3-Q050=":443"; '
41+
b'ma=2592000,h3-Q046=":443";'
3442
b' ma=2592000,h3-Q043=":443"; ma=2592000,quic=":443"; ma=2592000; v="46,43"\r\n'
3543
b"Accept-Ranges: none\r\n"
3644
b"Vary: Accept-Encoding\r\n"
@@ -39,10 +47,14 @@
3947

4048
# response body returned from the initial request (needs to be chunked.)
4149
BODY_REDIRECT = (
42-
b'<HTML>\n<HEAD>\n<TITLE>Temporary Redirect</TITLE>\n</HEAD>\n<BODY BGCOLOR="#FFFFFF" TEXT="#000000">\n'
43-
b'<H1>Temporary Redirect</H1>\nThe document has moved <A HREF="https://doc-14-2g-sheets.googleusercontent.com/pub'
44-
b"/70cmver1f290kjsnpar5ku2h9g/3llvt5u8njbvat22m9l19db1h4/1656191325000/109226138307867586192/*/e@2PACX-1vR1WjUKz35-"
45-
b'ek6SiR5droDfvPp51MTds4wUs57vEZNh2uDfihSTPhTaiiRovLbNe1mkeRgurppRJ_Zy?output=tsv">here</A>.\n</BODY>\n</HTML>\n'
50+
b"<HTML>\n<HEAD>\n<TITLE>Temporary Redirect</TITLE>\n</HEAD>\n"
51+
b'<BODY BGCOLOR="#FFFFFF" TEXT="#000000">\n'
52+
b"<H1>Temporary Redirect</H1>\nThe document has moved "
53+
b'<A HREF="https://doc-14-2g-sheets.googleusercontent.com/pub'
54+
b"/70cmver1f290kjsnpar5ku2h9g/3llvt5u8njbvat22m9l19db1h4/1656191325000"
55+
b"/109226138307867586192/*/e@2PACX-1vR1WjUKz35-"
56+
b"ek6SiR5droDfvPp51MTds4wUs57vEZNh2uDfihSTPhTaiiRovLbNe1mkeRgurppRJ_Zy?"
57+
b'output=tsv">here</A>.\n</BODY>\n</HTML>\n'
4658
)
4759

4860
# response headers from the request to the redirected location
@@ -54,16 +66,21 @@
5466
b"Expires: Sat, 25 Jun 2022 21:08:49 GMT\r\n"
5567
b"Date: Sat, 25 Jun 2022 21:08:49 GMT\r\n"
5668
b"Cache-Control: private, max-age=300\r\n"
57-
b"Content-Disposition: attachment; filename=\"WeeklyPlanner-Sheet1.tsv\"; filename*=UTF-8''Weekly%20Planner%20-%20Sheet1.tsv\r\n"
69+
b'Content-Disposition: attachment; filename="WeeklyPlanner-Sheet1.tsv"; '
70+
b"filename*=UTF-8''Weekly%20Planner%20-%20Sheet1.tsv\r\n"
5871
b"Access-Control-Allow-Origin: *\r\n"
59-
b"Access-Control-Expose-Headers: Cache-Control,Content-Disposition,Content-Encoding,Content-Length,Content-Type,Date,Expires,Server,Transfer-Encoding\r\n"
72+
b"Access-Control-Expose-Headers: Cache-Control,Content-Disposition,Content-Encoding,"
73+
b"Content-Length,Content-Type,Date,Expires,Server,Transfer-Encoding\r\n"
6074
b"Content-Security-Policy: frame-ancestors 'self' https://docs.google.com\r\n"
61-
b"Content-Security-Policy: base-uri 'self';object-src 'self';report-uri https://doc-14-2g-sheets.googleusercontent.com/spreadsheets/cspreport;"
62-
b"script-src 'report-sample' 'nonce-6V57medLoq3hw2BWeyGu_A' 'unsafe-inline' 'strict-dynamic' https: http: 'unsafe-eval';worker-src 'self' blob:\r\n"
75+
b"Content-Security-Policy: base-uri 'self';object-src 'self';report-uri https://"
76+
b"doc-14-2g-sheets.googleusercontent.com/spreadsheets/cspreport;"
77+
b"script-src 'report-sample' 'nonce-6V57medLoq3hw2BWeyGu_A' 'unsafe-inline' 'strict-dynamic'"
78+
b" https: http: 'unsafe-eval';worker-src 'self' blob:\r\n"
6379
b"X-Content-Type-Options: nosniff\r\n"
6480
b"X-XSS-Protection: 1; mode=block\r\n"
6581
b"Server: GSE\r\n"
66-
b'Alt-Svc: h3=":443"; ma=2592000,h3-29=":443"; ma=2592000,h3-Q050=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443";'
82+
b'Alt-Svc: h3=":443"; ma=2592000,h3-29=":443"; ma=2592000,h3-Q050=":443"; '
83+
b'ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443";'
6784
b' ma=2592000,quic=":443"; ma=2592000; v="46,43"\r\n'
6885
b"Accept-Ranges: none\r\n"
6986
b"Vary: Accept-Encoding\r\n"

0 commit comments

Comments
 (0)