コード例 #1
0
 def test_if_default_conf_is_set(self):
     app = create_app()
     self.assertEqual(app.config.get("DEBUG"), False)
コード例 #2
0
from src.python.ws import create_app

if __name__ == "__main__":
    create_app("src.python.ws.conf.DevelopmentConfig").run()
コード例 #3
0
 def test_if_test_conf_is_set(self):
     app = create_app("src.python.ws.conf.TestingConfig")
     self.assertEqual(app.config.get("TESTING"), True)
コード例 #4
0
 def test_if_development_conf_is_set(self):
     app = create_app("src.python.ws.conf.DevelopmentConfig")
     self.assertEqual(app.config.get("DEBUG"), True)
コード例 #5
0
 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)
コード例 #6
0
 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)
コード例 #7
0
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")