Added unittest for mimetypes and dependency for magic.