Skip to content

Commit

Permalink
Update .env
Browse files Browse the repository at this point in the history
  • Loading branch information
Boris committed Oct 19, 2023
1 parent 8d02d94 commit 150e73e
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 5 deletions.
Empty file modified .env
100644 → 100755
Empty file.
2 changes: 1 addition & 1 deletion src/configs/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,5 +91,5 @@ def get_settings() -> Settings:
namespace=os.environ.get("NAMESPACE"),
root_path=os.environ.get("ROOT_PATH"),
use_incluster_config=os.environ.get("USE_INCLUSTER_CONFIG", "").lower() == "true",
vcs_ref=os.environ.get("GIT_COMMIT_HASH"),
vcs_ref=os.environ.get("GIT_COMMIT_HASH", "unknown"),
)
2 changes: 1 addition & 1 deletion test/src/configs/test_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def test_get_settings_from_env(cleared_settings):
assert cleared_settings.git_url == "https://github.com/kbase/service_wizard2"
assert cleared_settings.root_path == "/"
assert cleared_settings.use_incluster_config is False
assert cleared_settings.vcs_ref == os.environ.get("GIT_COMMIT_HASH")
assert cleared_settings.vcs_ref == os.environ.get("GIT_COMMIT_HASH", "unknown")


def test_missing_env(cleared_settings):
Expand Down
5 changes: 2 additions & 3 deletions test/src/routes/test_unauthenticated_routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,11 @@ def test_status(app):
client = TestClient(app)
response = client.get("/status")
assert response.status_code == 200
assert response.json() == {"git_commit_hash": "1.2.3", "git_url": "https://github.com/kbase/service_wizard2", "message": "", "state": "OK", "version": "1.2.3"}
# Version is 'None' in pycharm if you don't set env var
assert response.json() == {"git_commit_hash": "unknown", "git_url": "https://github.com/kbase/service_wizard2", "message": "", "state": "OK", "version": "unknown"}


def test_version(app):
client = TestClient(app)
response = client.get("/version")
assert response.status_code == 200
assert response.json() == ["1.2.3"] # 'None' in pycharm
assert response.json() == ["unknown"] # 'None' in pycharm

0 comments on commit 150e73e

Please sign in to comment.