Skip to content

Commit

Permalink
Merge pull request #1446 from iElectric/guess_mimtype_test_fix
Browse files Browse the repository at this point in the history
fixes #1405
  • Loading branch information
mmerickel committed Nov 11, 2014
2 parents 1b584cf + 7a76cd0 commit b59b01c
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions pyramid/tests/test_response.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import io
import mimetypes
import os
import unittest
from pyramid import testing
Expand Down Expand Up @@ -51,15 +52,11 @@ def test_with_pdf_content_type(self):
r.app_iter.close()

def test_without_content_type(self):
for suffix, content_type in (
('txt', 'text/plain; charset=UTF-8'),
('xml', 'application/xml; charset=UTF-8'),
('pdf', 'application/pdf')
):
for suffix in ('txt', 'xml', 'pdf'):
path = self._getPath(suffix)
r = self._makeOne(path)
self.assertEqual(r.content_type, content_type.split(';')[0])
self.assertEqual(r.headers['content-type'], content_type)
self.assertEqual(r.headers['content-type'].split(';')[0],
mimetypes.guess_type(path, strict=False)[0])
r.app_iter.close()

def test_python_277_bug_15207(self):
Expand Down

0 comments on commit b59b01c

Please sign in to comment.