Ejemplo n.º 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'
Ejemplo n.º 2
0
    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'
Ejemplo n.º 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()
Ejemplo n.º 4
0
#!/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()
Ejemplo n.º 5
0
def app():
    app = create_app('tenki.settings.TestConfig')
    # app.dbRedis = FlaskRedis.from_custom_provider(MockRedisWrapper, app)

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

    yield app