Passed
Pull Request — master (#321)
by Jaisen
02:12
created

elodie.tests.run_tests   A

Complexity

Total Complexity 0

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 0
eloc 21
dl 0
loc 27
rs 10
c 0
b 0
f 0
1
#!/usr/bin/env python
2
3
import nose
4
import os
5
import shutil
6
import sys
7
import tempfile
8
9
if __name__ == "__main__":
10
    os.environ['ELODIE_APPLICATION_DIRECTORY'] = tempfile.mkdtemp('-elodie-test')
11
    os.environ['ELODIE_MAPQUEST_KEY'] = 'x8wQLqGhW7qK3sFpjYtVTogVtoMK0S8s'
12
    print('Application Directory: {}'.format(os.environ['ELODIE_APPLICATION_DIRECTORY']))
13
14
    project_root = os.path.abspath(os.path.join(os.path.dirname( __file__ ), '..', '..'))
15
    shutil.copy2(
16
        '{}/config.ini-sample'.format(project_root),
17
        '{}/config.ini'.format(os.environ['ELODIE_APPLICATION_DIRECTORY'])
18
    )
19
    test_directory = os.path.dirname(os.path.abspath(__file__))
20
    test_argv = sys.argv
21
    test_argv.append('--verbosity=2')
22
    result = nose.run(argv=test_argv)
23
    if(result):
24
        sys.exit(0)
25
    else:
26
        sys.exit(1)
27