Skip to content

Commit

Permalink
feat(refactor): Remove unused function (#265)
Browse files Browse the repository at this point in the history
### Changed

- Remove function get_latest_analysis_status as it is not used.
  • Loading branch information
henrikstranneheim committed Aug 28, 2023
1 parent f0befaa commit 8b7b580
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 28 deletions.
22 changes: 0 additions & 22 deletions tests/store/test_store_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,28 +77,6 @@ def test_add_comment(analysis_store: MockStore):
assert analysis_obj.comment == comment


@pytest.mark.parametrize(
"family, expected_status",
[
("blazinginsect", "running"), # running
("nicemice", "completed"), # completed
("lateraligator", "failed"), # failed
("escapedgoat", "pending"), # pending
],
)
def test_get_latest_analysis_status(analysis_store: MockStore, family: str, expected_status: str):
# GIVEN an analysis
analysis_store.update_ongoing_analyses()
analysis_objs = analysis_store.analyses(case_id=family).first()
assert analysis_objs is not None

# WHEN checking if the family has an analysis status
status = analysis_store.get_latest_analysis_status(case_id=family)

# THEN it should return the expected result
assert status is expected_status


@pytest.mark.parametrize(
"case_id, status",
[
Expand Down
6 changes: 0 additions & 6 deletions trailblazer/store/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,6 @@ def analyses(
def get_latest_analysis(self, case_id: str) -> Optional[Analysis]:
return self.analyses(case_id=case_id).first()

def get_latest_analysis_status(self, case_id: str) -> Optional[str]:
"""Get the latest analysis status for a case_id"""
latest_analysis = self.get_latest_analysis(case_id=case_id)
if latest_analysis:
return latest_analysis.status

def mark_analyses_deleted(self, case_id: str) -> Query:
"""mark analyses connected to a case as deleted"""
old_analyses = self.analyses(case_id=case_id)
Expand Down

0 comments on commit 8b7b580

Please sign in to comment.