mirror of
https://git.anonymousland.org/anonymousland/synapse-product.git
synced 2025-08-04 00:24:10 -04:00
Run Black. (#5482)
This commit is contained in:
parent
7dcf984075
commit
32e7c9e7f2
376 changed files with 9142 additions and 10388 deletions
|
@ -21,17 +21,17 @@ from tests import unittest
|
|||
class GetFileNameFromHeadersTests(unittest.TestCase):
|
||||
# input -> expected result
|
||||
TEST_CASES = {
|
||||
b"inline; filename=abc.txt": u"abc.txt",
|
||||
b'inline; filename="azerty"': u"azerty",
|
||||
b'inline; filename="aze%20rty"': u"aze%20rty",
|
||||
b'inline; filename="aze\"rty"': u'aze"rty',
|
||||
b'inline; filename="azer;ty"': u"azer;ty",
|
||||
b"inline; filename*=utf-8''foo%C2%A3bar": u"foo£bar",
|
||||
b"inline; filename=abc.txt": "abc.txt",
|
||||
b'inline; filename="azerty"': "azerty",
|
||||
b'inline; filename="aze%20rty"': "aze%20rty",
|
||||
b'inline; filename="aze"rty"': 'aze"rty',
|
||||
b'inline; filename="azer;ty"': "azer;ty",
|
||||
b"inline; filename*=utf-8''foo%C2%A3bar": "foo£bar",
|
||||
}
|
||||
|
||||
def tests(self):
|
||||
for hdr, expected in self.TEST_CASES.items():
|
||||
res = get_filename_from_headers({b'Content-Disposition': [hdr]})
|
||||
res = get_filename_from_headers({b"Content-Disposition": [hdr]})
|
||||
self.assertEqual(
|
||||
res,
|
||||
expected,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue