|
6 | 6 |
|
7 | 7 | from unittest import mock
|
8 | 8 | import mocket
|
9 |
| -import adafruit_requests |
10 | 9 | from chunk_test import _chunk
|
| 10 | +import adafruit_requests |
11 | 11 |
|
12 | 12 | IP = "1.2.3.4"
|
13 | 13 | 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 | +) |
15 | 18 |
|
16 | 19 | # response headers returned from the initial request
|
17 | 20 | HEADERS_REDIRECT = (
|
|
21 | 24 | b"Pragma: no-cache\r\n"
|
22 | 25 | b"Expires: Mon, 01 Jan 1990 00:00:00 GMT\r\n"
|
23 | 26 | 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" |
26 | 31 | b'P3P: CP="This is not a P3P policy! See g.co/p3phelp for more info."\r\n'
|
27 | 32 | b"X-Content-Type-Options: nosniff\r\n"
|
28 | 33 | b"X-XSS-Protection: 1; mode=block\r\n"
|
29 | 34 | 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=/; " |
32 | 39 | 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";' |
34 | 42 | b' ma=2592000,h3-Q043=":443"; ma=2592000,quic=":443"; ma=2592000; v="46,43"\r\n'
|
35 | 43 | b"Accept-Ranges: none\r\n"
|
36 | 44 | b"Vary: Accept-Encoding\r\n"
|
|
39 | 47 |
|
40 | 48 | # response body returned from the initial request (needs to be chunked.)
|
41 | 49 | 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' |
46 | 58 | )
|
47 | 59 |
|
48 | 60 | # response headers from the request to the redirected location
|
|
54 | 66 | b"Expires: Sat, 25 Jun 2022 21:08:49 GMT\r\n"
|
55 | 67 | b"Date: Sat, 25 Jun 2022 21:08:49 GMT\r\n"
|
56 | 68 | 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" |
58 | 71 | 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" |
60 | 74 | 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" |
63 | 79 | b"X-Content-Type-Options: nosniff\r\n"
|
64 | 80 | b"X-XSS-Protection: 1; mode=block\r\n"
|
65 | 81 | 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";' |
67 | 84 | b' ma=2592000,quic=":443"; ma=2592000; v="46,43"\r\n'
|
68 | 85 | b"Accept-Ranges: none\r\n"
|
69 | 86 | b"Vary: Accept-Encoding\r\n"
|
|
0 commit comments