Bug 61817 - test-mime.MimeTest fails
Summary: test-mime.MimeTest fails
Status: RESOLVED FIXED
Alias: None
Product: PyXDG
Classification: Unclassified
Component: PyXDG (show other bugs)
Version: unspecified
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Thomas Kluyver
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-03-04 22:04 UTC by Tom Callaway
Modified: 2013-03-05 16:21 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description Tom Callaway 2013-03-04 22:04:04 UTC
+ nosetests
............................F.......
======================================================================
FAIL: test_get_type (test-mime.MimeTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/pyxdg-0.25/test/test-mime.py", line 40, in test_get_type
    self.check_mimetype(imgpng, 'image', 'png')
  File "/builddir/build/BUILD/pyxdg-0.25/test/test-mime.py", line 11, in check_mimetype
    self.assertEqual(mimetype.subtype, subtype)
AssertionError: 'x-apple-ios-png' != 'png'
----------------------------------------------------------------------

This is with Python 2.7 on Fedora 19. I can only assume that some sort of globbing is generating "x-apple-ios-png" as a result for that comparison.

/usr/share/mime/image/x-apple-ios-png.xml exists, as part of shared-mime-info-1.1-4.fc19.
Comment 1 Thomas Kluyver 2013-03-05 11:12:08 UTC
About the only reference to this I can find is a commit message from Horde: '...ridiculous MIME types like "image/x-apple-ios-png" that
overwrite the correct MIME types'.

Looking at the spec, it seems to be ambiguous what the correct type is in a case like that, at least when the file isn't available to sniff the contents, which is what this test is for. Except of course we know that image/png is the answer we want.

I'll ask on the mailing list to get a clearer idea about this.
Comment 2 Thomas Kluyver 2013-03-05 15:11:01 UTC
This change should fix that case, although I'm planning a proper rework of xdg.Mime:

https://github.com/takluyver/pyxdg/commit/f87e662ed27edf88152dd6980120b2cf64890db9

(I'll transfer it to the official PyXDG repository this evening)
Comment 3 Tom Callaway 2013-03-05 16:19:28 UTC
Patch works, thanks!


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.