Add more tests

This commit is contained in:
Akshay Sharma 2021-09-20 22:44:13 -04:00
parent c81605abe6
commit 66e3b40043
1 changed files with 9 additions and 2 deletions

View File

@ -120,8 +120,15 @@ class ResponseTypesTest(unittest.TestCase):
'Content-Type': ['text/html']})}, HtmlResponse),
({'body': b'Some plain text', 'headers': Headers({'Content-Type': 'application/octet-stream'})},
TextResponse),
({'url': b'http://www.example.com/page/file.html', 'headers': Headers({'Content-Type': 'application/octet-stream'})},
TextResponse),
({'url': b'http://www.example.com/page/file.html',
'headers': Headers({'Content-Type': 'application/octet-stream'})}, TextResponse),
({'url': 'http://www.example.com/item/file.xml',
'headers': Headers({'Content-Type': 'application/octet-stream'})}, TextResponse),
({'url': 'http://www.example.com/item/file.html',
'headers': Headers({'Content-Type': 'application/octet-stream'})}, TextResponse),
({'url': 'http://www.example.com/item/file.xml',
'headers': Headers({'Content-Disposition': ['attachment; filename="data.xml.gz"'],
'Content-Type': 'application/octet-stream'})}, TextResponse),
({'body': b'\x0c\x1b'}, TextResponse),
({'body': b'this is not <html>'}, TextResponse),
({'body': b'this is not <?xml'}, TextResponse),