Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
rfc6266
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
rfc6266
Commits
fefcfd32
Commit
fefcfd32
authored
Jan 30, 2012
by
Gabriel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Split out the roundtrip tests and add more.
parent
7a3a85b2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
1 deletions
+8
-1
rfc6266.py
+8
-1
No files found.
rfc6266.py
View file @
fefcfd32
...
@@ -356,7 +356,7 @@ def header_for_filename(
...
@@ -356,7 +356,7 @@ def header_for_filename(
return
rv
.
encode
(
'iso-8859-1'
)
return
rv
.
encode
(
'iso-8859-1'
)
def
test_
cdfh
():
def
test_
parsing
():
cdfh
=
ContentDisposition
.
from_headers
cdfh
=
ContentDisposition
.
from_headers
assert
ContentDisposition
()
.
disposition
==
'inline'
assert
ContentDisposition
()
.
disposition
==
'inline'
assert
cdfh
(
'attachment'
)
.
disposition
==
'attachment'
assert
cdfh
(
'attachment'
)
.
disposition
==
'attachment'
...
@@ -372,6 +372,8 @@ def test_cdfh():
...
@@ -372,6 +372,8 @@ def test_cdfh():
' filename*=utf-8
\'\'
%
e2
%82%
ac
%20
rates'
)
' filename*=utf-8
\'\'
%
e2
%82%
ac
%20
rates'
)
assert
cd
.
filename_unsafe
==
u'€ rates'
assert
cd
.
filename_unsafe
==
u'€ rates'
def
test_roundtrip
():
def
roundtrip
(
filename
):
def
roundtrip
(
filename
):
return
ContentDisposition
.
from_headers
(
return
ContentDisposition
.
from_headers
(
header_for_filename
(
filename
))
.
filename_unsafe
header_for_filename
(
filename
))
.
filename_unsafe
...
@@ -379,6 +381,11 @@ def test_cdfh():
...
@@ -379,6 +381,11 @@ def test_cdfh():
def
assert_roundtrip
(
filename
):
def
assert_roundtrip
(
filename
):
assert
roundtrip
(
filename
)
==
filename
assert
roundtrip
(
filename
)
==
filename
assert_roundtrip
(
'a b'
)
assert_roundtrip
(
'a b'
)
assert_roundtrip
(
'a b '
)
assert_roundtrip
(
' a b'
)
assert_roundtrip
(
'a
\"
b'
)
assert_roundtrip
(
u'aéio o♥u"qfsdf!'
)
assert_roundtrip
(
u'aéio o♥u"qfsdf!'
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment