Skip to content

Commit

Permalink
update test
Browse files Browse the repository at this point in the history
  • Loading branch information
AjitPadhi-Microsoft committed Nov 15, 2024
1 parent 8ca6525 commit bc4879a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
3 changes: 2 additions & 1 deletion ClientAdvisor/App/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,9 @@

def create_app():
app = Quart(__name__)
app.register_blueprint(bp)
app.config["PROVIDE_AUTOMATIC_OPTIONS"] = True
app.config["TEMPLATES_AUTO_RELOAD"] = True
app.register_blueprint(bp)
# app.secret_key = secrets.token_hex(16)
# app.session_interface = SecureCookieSessionInterface()
return app
Expand Down
11 changes: 10 additions & 1 deletion ClientAdvisor/App/tests/test_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,12 @@ def set_env_vars():
@pytest.fixture
def flaskapp():
"""Create a test client for the app."""
return create_app()
app = create_app()
app.config.update({
"TESTING": True,
"PROVIDE_AUTOMATIC_OPTIONS": True, # Ensure this is set in the test environment
})
return app


@pytest.fixture
Expand All @@ -53,6 +58,10 @@ def client(flaskapp):

def test_create_app():
app = create_app()
app.config.update({
"TESTING": True,
"PROVIDE_AUTOMATIC_OPTIONS": True, # Ensure this is set in the test environment
})
assert app is not None
assert app.name == "app"
assert "routes" in app.blueprints
Expand Down

0 comments on commit bc4879a

Please sign in to comment.