示例#1
0
文件: manage.py 项目: huangjien/autoP
#!/usr/bin/env python
import os
from autoP import create_app
from autoP.models import *
from flask_script import Manager, Shell

# from flask_migrate import Migrate

app = create_app(os.getenv('CONFIG') or 'default')
manager = Manager(app)


# migrate = Migrate(app)


def make_shell_context():
    return {'app': app, 'User': User, 'Permission': Permission, 'Role': Role, 'Result': Result,
            'StepResult': StepResult, 'DataObject': DataObject}


manager.add_command('shell', Shell(make_context=make_shell_context))


@manager.command
def test():
    import unittest
    tests_dir = os.path.abspath('.')
    tests = unittest.TestLoader().discover(tests_dir)
    unittest.TextTestRunner(verbosity=2).run(tests)

示例#2
0
 def setUpClass(cls):
     cls.app = create_app('testing')
     cls.current_app = cls.app
     cls.app_context = cls.app.app_context()
     cls.app_context.push()
示例#3
0
from os import environ
from autoP import create_app

if __name__ == "__main__":
    config = environ.get("CONFIG") or "default"
    app = create_app(config)
    app.run()
示例#4
0
 def setUpClass(cls):
     cls.app = create_app('testing')
     cls.current_app = cls.app
     cls.app_context = cls.app.app_context()
     cls.app_context.push()
示例#5
0
 def setUpClass(cls):
     cls.app = create_app('testing')  # testing is lower case
     cls.current_app = cls.app
     cls.app_context = cls.app.app_context()
     cls.app_context.push()
     init_db()
示例#6
0
 def setUpClass(cls):
     cls.app = create_app('testing')  # testing is lower case
     cls.current_app = cls.app
     cls.app_context = cls.app.app_context()
     cls.app_context.push()
     init_db()
示例#7
0
文件: manage.py 项目: pangyazhi/autoP
#!/usr/bin/env python
import os
from autoP import create_app
from autoP.models import *
from flask_script import Manager, Shell

# from flask_migrate import Migrate

app = create_app(os.getenv('CONFIG') or 'default')
manager = Manager(app)

# migrate = Migrate(app)


def make_shell_context():
    return {
        'app': app,
        'User': User,
        'Permission': Permission,
        'Role': Role,
        'Result': Result,
        'StepResult': StepResult,
        'DataObject': DataObject
    }


manager.add_command('shell', Shell(make_context=make_shell_context))


@manager.command
def test():