-
Notifications
You must be signed in to change notification settings - Fork 9
/
manage.py
33 lines (27 loc) · 1.08 KB
/
manage.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# coding=utf-8
"""
manage
~~~~~~
Provides useful commands to manage the project
"""
import sys, subprocess
from toolkit_library.inspector import ModuleInspector, PackageInspector
from toolkit_library.input_util import InputUtil
from quick_orm import examples
def run_examples():
"""Run all of the examples"""
# automatically install the newest code before testing
subprocess.call([sys.executable, 'setup.py', 'install'])
# call each example file and print the result
for module in PackageInspector(examples).get_all_modules():
print '****** {0} ******'.format(module)
subprocess.call([sys.executable, 'quick_orm/examples/{0}.py'.format(module)])
print
def run_tests():
"""Run unit tests"""
from quick_orm.testsuite import run_testsuite
db_name = InputUtil.get_input('database', default = 'sqlite', pattern = '(?:mysql|sqlite|postgresql)')
run_testsuite(db_name)
if __name__ == '__main__':
inspector = ModuleInspector(sys.modules[__name__])
inspector.invoke(*sys.argv[1:])