def test_if_default_conf_is_set(self): app = create_app() self.assertEqual(app.config.get("DEBUG"), False)
from src.python.ws import create_app if __name__ == "__main__": create_app("src.python.ws.conf.DevelopmentConfig").run()
def test_if_test_conf_is_set(self): app = create_app("src.python.ws.conf.TestingConfig") self.assertEqual(app.config.get("TESTING"), True)
def test_if_development_conf_is_set(self): app = create_app("src.python.ws.conf.DevelopmentConfig") self.assertEqual(app.config.get("DEBUG"), True)
def test_if_root_path_exists(self): tester = create_app().test_client(self) response = tester.get("/", content_type="html/text") self.assertEqual(response.status_code, 200)
def test_if_fake_path_does_not_exist(self): tester = create_app().test_client(self) response = tester.get("/fake_path", content_type="html/text") self.assertEqual(response.status_code, 404)
from src.python.ws import create_app app = create_app(config_filename="src.python.ws.conf.DevelopmentConfig") if __name__ == "__main__": app.run(host="0.0.0.0")