Skip to content

Commit fd58f83

Browse files
linting.
1 parent 29d88e9 commit fd58f83

File tree

2 files changed

+4
-23
lines changed

2 files changed

+4
-23
lines changed

tests/integration/conftest.py

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -411,15 +411,6 @@ def persisted_person_factory(
411411
hashing_service: HashingService,
412412
request: pytest.FixtureRequest,
413413
):
414-
"""
415-
Factory to persist a PERSON/COHORT record with different hashing strategies:
416-
secret_key="current" -> hash_with_current_secret
417-
secret_key="previous" -> hash_with_previous_secret
418-
secret_key="none" -> store plain NHS number (no hash)
419-
420-
All created rows are automatically cleaned up.
421-
"""
422-
423414
created_rows: list[dict[str, Any]] = []
424415

425416
def _factory(
@@ -433,15 +424,15 @@ def _factory(
433424
nhs_num = faker.nhs_number()
434425
nhs_number = eligibility_status.NHSNumber(nhs_num)
435426

436-
# --- hashing selector ---
427+
# hashing selector
437428
if secret_key == "current": # noqa: S105
438429
nhs_key = hashing_service.hash_with_current_secret(nhs_num)
439430
elif secret_key == "previous": # noqa: S105
440431
nhs_key = hashing_service.hash_with_previous_secret(nhs_num)
441432
elif secret_key == "not_hashed": # noqa: S105
442433
nhs_key = nhs_num
443434

444-
# --- build DOB ---
435+
# build DOB
445436
date_of_birth = eligibility_status.DateOfBirth(
446437
faker.date_of_birth(minimum_age=minimum_age, maximum_age=maximum_age)
447438
)
@@ -453,14 +444,14 @@ def _factory(
453444
cohorts=cohorts or ["cohort1"],
454445
).data
455446

456-
# --- persist rows ---
447+
# persist rows
457448
for row in rows:
458449
person_table.put_item(Item=row)
459450
created_rows.append(row)
460451

461452
return nhs_number
462453

463-
# --- cleanup hook ---
454+
# cleanup hook
464455
def cleanup():
465456
for row in created_rows:
466457
person_table.delete_item(

tests/integration/repo/test_person_repo.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -201,51 +201,41 @@ def test_get_person_record_returns_none_when_items_have_no_person_attribute_type
201201
# and record plain does not exist
202202
# then return record AWSCurrent with key AWSCurrent
203203
(True, False, "current", "current_record"),
204-
205204
# If key AWSCURRENT exists, record AWSCurrent not exists,
206205
# and key AWSPREVIOUS not exists, record AWSPREVIOUS not exist,
207206
# and record plain does not exist
208207
# then person not found
209208
(True, False, None, "person_not_found"),
210-
211209
# If key AWSCURRENT exists, record AWSCurrent not exists,
212210
# and key AWSPREVIOUS not exists, record AWSPREVIOUS not exist,
213211
# and record plain does exist
214212
# then return record plain
215213
(True, False, "not_hashed", "not_hashed_record"),
216-
217-
218214
# If key AWSCURRENT not exists, record AWSCurrent not exists,
219215
# and key AWSPREVIOUS exists, record AWSPREVIOUS exist,
220216
# and record plain does not exist
221217
# then return record AWSPrevious with key AWSPrevious
222218
(False, True, "previous", "previous_record"),
223-
224219
# If key AWSCURRENT not exists, record AWSCurrent not exists,
225220
# and key AWSPREVIOUS exists, record AWSPREVIOUS not exist,
226221
# and record plain does not exist
227222
# then person not found
228223
(False, True, None, "person_not_found"),
229-
230224
# If key AWSCURRENT not exists, record AWSCurrent not exists,
231225
# and key AWSPREVIOUS exists, record AWSPREVIOUS not exist,
232226
# and record plain does exist
233227
# then person not found
234228
(False, True, "not_hashed", "person_not_found"),
235-
236-
237229
# If key AWSCURRENT not exists, record AWSCurrent not exists,
238230
# and key AWSPREVIOUS not exists, record AWSPREVIOUS not exist,
239231
# and record plain does exist
240232
# then return record plain
241233
(False, False, "not_hashed", "not_hashed_record"),
242-
243234
# If key AWSCURRENT not exists, record AWSCurrent not exists,
244235
# and key AWSPREVIOUS not exists, record AWSPREVIOUS not exist,
245236
# and record plain does not exist
246237
# then return person not found
247238
(False, False, None, "person_not_found"),
248-
249239
],
250240
)
251241
def test_secret_key_scenarios( # noqa: PLR0913

0 commit comments

Comments
 (0)