Modify ↓
Opened 18 years ago
Closed 17 years ago
#3858 closed defect (fixed)
mimeview unit test fails
Reported by: | Owned by: | Christian Boos | |
---|---|---|---|
Priority: | low | Milestone: | 0.11 |
Component: | general | Version: | 0.10 |
Severity: | minor | Keywords: | mimeview |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description
This is likely related to #3332, but when I run the unit tests on 0.10, I get a failed assertion.
From my uninformed perspective, it appears that the defect is in the test code, rather than in the logic of get_mimetype().
I am running SLES10, x86_64, Python 2.4.2. Here's a snippet of svn info
from my working copy:
URL: http://svn.edgewall.com/repos/trac/tags/trac-0.10 Revision: 3804
Here's the test output:
$ PYTHONPATH=. trac/test.py SKIP: mimeview/tests/php.py .................................................................F............................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................ ====================================================================== FAIL: test_from_suffix_using_mimetypes (trac.mimeview.tests.api.GetMimeTypeTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/tmp/trac-svn/trac/mimeview/tests/api.py", line 26, in test_from_suffix_using_mimetypes get_mimetype('test.pyc', None)) AssertionError: 'application/x-python-code' != 'application/x-python-bytecode' ---------------------------------------------------------------------- Ran 590 tests in 39.788s FAILED (failures=1)
Attachments (0)
Change History (4)
comment:1 by , 18 years ago
Milestone: | → 0.10.1 |
---|---|
Owner: | changed from | to
comment:2 by , 17 years ago
Well, there are some other types available that should be quite standard. How about:
-
trac/mimeview/tests/api.py
25 25 self.assertEqual('text/plain', get_mimetype('README.txt', None)) 26 26 27 27 def test_from_suffix_using_mimetypes(self): 28 self.assertEqual(' application/x-python-code',29 get_mimetype(' test.pyc', None))28 self.assertEqual('image/png', 29 get_mimetype('doc/trac_logo.png', None)) 30 30 31 31 def test_from_content_using_CONTENT_RE(self): 32 32 self.assertEqual('text/x-python',
comment:3 by , 17 years ago
Milestone: | 0.10.5 → 0.11 |
---|
Please do ;-) (not worth doing for 0.10.x though)
Note:
See TracTickets
for help on using tickets.
Well, I guess it's a problem with Python's
mimetypes
module.Mine gives:
I guess we should pick a test case less susceptible to differ from platform to platform or version to version…