#!/usr/bin/env python
#
# Run the tests for the mailjam package

import os, shutil, sys, unittest

try:
    from mailjam.tests import *
except ImportError:
    sys.path.append(os.path.join(os.path.dirname(__file__), '../'))
    try:
        from mailjam.tests import *
    except ImportError:
        raise SystemExit('Could not find mailjam on your filesystem')

try:
    unittest.main()
finally:
    # FIXME: hardcoded path to the tmp directory, we should read this path
    # from mailjam/tests/mailjam.conf
    shutil.rmtree('/tmp/mailjam-tests')
