Skip to content

Commit 84a57c9

Browse files
committed
Fixed TODOs
1 parent 05053e1 commit 84a57c9

4 files changed

Lines changed: 8 additions & 8 deletions

File tree

src/eligibility_signposting_api/audit_models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from dataclasses import dataclass, field
2-
from datetime import datetime, UTC
2+
from datetime import UTC, datetime
33
from uuid import UUID
44

55

src/eligibility_signposting_api/services/calculators/eligibility_calculator.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,7 @@ def evaluate_eligibility(self, *, include_actions_flag: bool = True) -> eligibil
199199

200200
# add actions to condition results
201201
condition_results[condition_name].actions = actions
202+
# reset actions for the next condition
202203
actions: SuggestedActions | None = SuggestedActions([])
203204

204205
# add audit data
@@ -256,7 +257,7 @@ def get_cohort_results(self, active_iteration: rules.Iteration) -> dict[str, Coh
256257
# Not base eligible
257258
elif cohort.cohort_label is not None:
258259
cohort_results[cohort.cohort_label] = CohortGroupResult(
259-
(cohort.cohort_group),
260+
cohort.cohort_group,
260261
Status.not_eligible,
261262
[],
262263
cohort.negative_description,

src/eligibility_signposting_api/views/eligibility.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,7 @@ def check_eligibility(
4949
return handle_unknown_person_error(nhs_number)
5050
else:
5151
eligibility_response = build_eligibility_response(eligibility_status)
52-
5352
AuditContext.write_to_firehose(audit_service, eligibility_response)
54-
5553
return make_response(
5654
eligibility_response.model_dump(by_alias=True, mode="json", exclude_none=True), HTTPStatus.OK
5755
)

tests/unit/test_audit_context.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,7 @@
3333

3434
@pytest.fixture
3535
def app():
36-
app = Flask(__name__)
37-
return app
36+
return Flask(__name__)
3837

3938

4039
def test_add_request_details_sets_audit_log_on_g(app):
@@ -141,9 +140,11 @@ def test_append_audit_condition_adds_condition_to_audit_log_on_g(app):
141140
assert cond.status_text == best_results[1].status.name
142141

143142

144-
def test_add_response_details_adds_to_audit_log_on_G(app):
143+
def test_add_response_details_adds_to_audit_log_on_g(app):
145144
eligibility_response = EligibilityResponseFactory.build(
146-
response_id=uuid.uuid4(), meta={"last_updated": datetime(2023, 1, 1, 0, 0)}, processed_suggestions=[]
145+
response_id=uuid.uuid4(),
146+
meta={"last_updated": datetime(2023, 1, 1, 0, 0, tzinfo=UTC)},
147+
processed_suggestions=[],
147148
)
148149

149150
with app.app_context():

0 commit comments

Comments
 (0)