Implement mime.get_mime_parents using python

This is the only method pending implemented in c,
then we can remove seven files previously used.

Add a test for a corner case untested previously

Signed-off-by: Gonzalo Odiard <godiard@sugarlabs.org>
This commit is contained in:
Gonzalo Odiard
2014-01-30 18:33:17 -03:00
committed by Daniel Narvaez
parent faa0d42084
commit b02ade879a
2 changed files with 49 additions and 7 deletions
+4
View File
@@ -35,6 +35,10 @@ class TestMime(unittest.TestCase):
self.assertListEqual(mime.get_mime_parents("image/svg+xml"),
["application/xml"])
# If the mime type don't have parents, should return a empty array
self.assertListEqual(mime.get_mime_parents("application/octet-stream"),
[])
def test_get_for_file(self):
self.assertEqual(mime.get_for_file(os.path.join(data_dir, "mime.svg")),
'image/svg+xml')