Skip to content

Commit

Permalink
changed endpoint name to set_analysis_status
Browse files Browse the repository at this point in the history
  • Loading branch information
gustavlagneborg committed Dec 19, 2022
1 parent d08cf64 commit 4912a4b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion tests/store/test_store_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ def test_set_analysis_failed(sample_store):
analysis_obj: models.Analysis = sample_store.analyses().first()

# WHEN setting analysis to failed
sample_store.set_analysis_failed(case_id=analysis_obj.family, status="failed")
sample_store.set_analysis_status(case_id=analysis_obj.family, status="failed")

# THEN the column status should be updated with failed.
assert analysis_obj.status == "failed"
Expand Down
6 changes: 3 additions & 3 deletions trailblazer/server/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,12 +262,12 @@ def put_set_analysis_uploaded():
return jsonify(f"Exception: {error}"), 409


@blueprint.route("/set-analysis-failed", methods=["PUT"])
def put_set_analysis_failed():
@blueprint.route("/set-analysis-status", methods=["PUT"])
def put_set_analysis_status():
content: Response.json = request.json

try:
store.set_analysis_failed(case_id=content.get("case_id"), status=content.get("status"))
store.set_analysis_status(case_id=content.get("case_id"), status=content.get("status"))
return jsonify("Success! Analysis set to fail request sent"), 201
except Exception as error:
return jsonify(f"Exception: {error}"), 409
2 changes: 1 addition & 1 deletion trailblazer/store/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ def set_analysis_uploaded(self, case_id: str, uploaded_at: dt.datetime) -> None:
self.commit()
LOG.info(f"{analysis_obj.family} - uploaded at set to {uploaded_at}")

def set_analysis_failed(self, case_id: str, status: str):
def set_analysis_status(self, case_id: str, status: str):
"""Setting analysis status to failed."""
analysis_obj: models.Analysis = self.get_latest_analysis(case_id=case_id)
analysis_obj.status = status
Expand Down

0 comments on commit 4912a4b

Please sign in to comment.