FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
scrapy/tests/test_utils_http.py at master · jackcoolpython/scrapy · GitHub
jackcoolpython
scrapy
Repository navigation
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
scrapy
/
tests
/
test_utils_http.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
19 lines (15 loc) · 728 Bytes
Breadcrumbs
scrapy
/
tests
/
test_utils_http.py
Copy path
File metadata and controls
19 lines (15 loc) · 728 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import
unittest
from
scrapy
.
utils
.
http
import
decode_chunked_transfer
class
ChunkedTest
(
unittest
.
TestCase
):
def
test_decode_chunked_transfer
(
self
):
"""Example taken from: http://en.wikipedia.org/wiki/Chunked_transfer_encoding"""
chunked_body
=
"25
\r
\n
"
+
"This is the data in the first chunk
\r
\n
\r
\n
"
chunked_body
+=
"1C
\r
\n
"
+
"and this is the second one
\r
\n
\r
\n
"
chunked_body
+=
"3
\r
\n
"
+
"con
\r
\n
"
chunked_body
+=
"8
\r
\n
"
+
"sequence
\r
\n
"
chunked_body
+=
"0
\r
\n
\r
\n
"
body
=
decode_chunked_transfer
(
chunked_body
)
self
.
assertEqual
(
body
,
"This is the data in the first chunk
\r
\n
and this is the second one
\r
\n
consequence"
)
Back
|
FazBrowse Home
|
New Git URL