def test_dev_config(self): """Test if the development config loads correctly """ app = create_app('kaku.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'
def test_test_config(self): """Test if the test config loads correctly """ app = create_app('kaku.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'
#!/usr/bin/env python # -*- coding: utf-8 -*- """ :copyright: (c) 2016 by Mike Taylor :license: CC0 1.0 Universal, see LICENSE for more details. """ from kaku import create_app # ALWAYS start the service in production mode # # developer testing should be done using the # 'server' Makefile target application = create_app('kaku.settings.ProdConfig') if __name__ == "__main__": application.run()
def app(): app = create_app('kaku.settings.TestConfig') yield app
class Test(Command): def run(self): self.test_suite = True 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") env = os.environ.get('KAKU_ENV', 'dev') app = create_app('kaku.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) if __name__ == "__main__": manager.run()