예제 #1
0
    def setUp(self):
        self.app = create_app(self.config)
        self.app.testing = True
        self.ctx = self.app.test_request_context()
        self.ctx.push()

        self.client = self.app.test_client()
예제 #2
0
#!/usr/bin/env python
"""
Management script for the twentiment_api Flask project.

:author: 2012, Pascal Hartig <*****@*****.**>
:license: BSD
"""

import sys
import os
from flask.ext.script import Manager, Server

sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__))))

from twentiment_api.application import create_app

manager = Manager(create_app())
manager.add_command("runserver", Server(host="0.0.0.0", port=5000))


@manager.command
def test():
    os.system("unit2 discover")


if __name__ == "__main__":
    manager.run()