示例#1
0
    def test_test_config(self):
        """Test if the test config loads correctly
        """
        app = create_app('tenki.settings.TestConfig')

        assert app.config['DEBUG'] is True
        assert app.config['REDIS_URL'] == "redis://127.0.0.1:6379/0"
        assert app.config['CACHE_TYPE'] == 'null'
示例#2
0
文件: test_config.py 项目: bear/tenki
    def test_dev_config(self):
        """Test if the development config loads correctly
        """
        app = create_app('tenki.settings.DevConfig')

        assert app.config['DEBUG'] is True
        assert app.config['REDIS_URL']  == "redis://127.0.0.1:6379/0"
        assert app.config['CACHE_TYPE'] == 'null'
示例#3
0
        test()


class Integration(Command):
    def run(self):
        self.test_suite = True
        test(marker="integration")


class WebTests(Command):
    def run(self):
        self.test_suite = True
        test(marker="web")


# default to dev config because no one should use this in
# production anyway
env = os.environ.get('TENKI_ENV', 'dev')
app = create_app('tenki.settings.%sConfig' % env.capitalize())

manager = Manager(app)
manager.add_command("server", Server)
manager.add_command("show-urls", ShowUrls)
manager.add_command("clean", Clean)
manager.add_command("test", Test)
manager.add_command("integration", Integration)
manager.add_command("webtest", WebTests)

if __name__ == "__main__":
    manager.run()
示例#4
0
文件: uwsgi-app.py 项目: bear/tenki
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
:copyright: (c) 2009-2016 by Mike Taylor
:license: CC0 1.0 Universal, see LICENSE for more details.
"""

import os

from tenki import create_app

env = os.environ.get('TENKI_ENV', 'dev')
application = create_app('tenki.settings.%sConfig' % env.capitalize())

if __name__ == "__main__":
    application.run()
示例#5
0
文件: conftest.py 项目: bear/tenki
def app():
    app = create_app('tenki.settings.TestConfig')
    # app.dbRedis = FlaskRedis.from_custom_provider(MockRedisWrapper, app)

    yield app
示例#6
0
def app():
    app = create_app('tenki.settings.TestConfig')
    # app.dbRedis = FlaskRedis.from_custom_provider(MockRedisWrapper, app)

    yield app