#260: "import magic" should be tested more thoroughly
-----------------------+----------------------------------------------------
Reporter: bthiell | Owner: bthiell
Type: defect | Status: new
Priority: minor | Milestone:
Component: *general* | Version:
Keywords: |
-----------------------+----------------------------------------------------
In [[source:modules/websubmit/lib/bibdocfile.py#L66|bibdocfile]],
[[source:modules/elmsubmit/lib/elmsubmit_filename_generator.py#L33|elmsubmit_filename_generator]]
and [[source:configure-tests.py#L240|configure-tests]], we test the import
of the module magic. These tests are not sufficient as other Python
modules are named magic but do not offer all the variables or functions
needed in the code.
So we also need to test that all variables and functions used are present
in the imported module, e.g.:
{{{
try:
import magic
if not hasattr(magic, 'open'):
raise ImportError
CFG_HAS_MAGIC = True
except ImportError:
CFG_HAS_MAGIC = False
}}}
--
Ticket URL: <http://invenio-software.org/ticket/260>
Invenio <http://invenio-software.org>