From 745edec7be7c4c4be56cbdf01ffe3543cb3348e2 Mon Sep 17 00:00:00 2001 From: Michael Merickel Date: Fri, 16 May 2014 21:34:02 -0500 Subject: close resources and 80-char line width --- pyramid/response.py | 3 ++- pyramid/tests/test_response.py | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/pyramid/response.py b/pyramid/response.py index 6b5f0a561..adc903b44 100644 --- a/pyramid/response.py +++ b/pyramid/response.py @@ -53,7 +53,8 @@ class FileResponse(Response): def __init__(self, path, request=None, cache_max_age=None, content_type=None, content_encoding=None): if content_type is None: - content_type, content_encoding = mimetypes.guess_type(path, strict=False) + content_type, content_encoding = ( + mimetypes.guess_type(path, strict=False)) if content_type is None: content_type = 'application/octet-stream' super(FileResponse, self).__init__( diff --git a/pyramid/tests/test_response.py b/pyramid/tests/test_response.py index 8061ecac5..8731fa764 100644 --- a/pyramid/tests/test_response.py +++ b/pyramid/tests/test_response.py @@ -25,7 +25,7 @@ class TestFileResponse(unittest.TestCase): def _getPath(self, suffix='txt'): here = os.path.dirname(__file__) - return os.path.join(here, 'fixtures', 'minimal.%s'%(suffix,)) + return os.path.join(here, 'fixtures', 'minimal.%s' % (suffix,)) def test_with_image_content_type(self): path = self._getPath('jpg') @@ -33,12 +33,14 @@ class TestFileResponse(unittest.TestCase): self.assertEqual(r.content_type, 'image/jpeg') self.assertEqual(r.headers['content-type'], 'image/jpeg') path = self._getPath() + r.app_iter.close() def test_with_xml_content_type(self): path = self._getPath('xml') r = self._makeOne(path, content_type='application/xml') self.assertEqual(r.content_type, 'application/xml') - self.assertEqual(r.headers['content-type'], 'application/xml; charset=UTF-8') + self.assertEqual(r.headers['content-type'], + 'application/xml; charset=UTF-8') r.app_iter.close() def test_with_pdf_content_type(self): -- cgit v1.2.3