Skip to content

Commit 5b3ca38

Browse files
committed
fixing sonarcube duplicates
1 parent 6fb51c4 commit 5b3ca38

File tree

1 file changed

+18
-23
lines changed

1 file changed

+18
-23
lines changed

tests/regression/regression_tests/fobt_regression_tests/test_scenario_14.py

Lines changed: 18 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,7 @@
1313
from utils.user_tools import UserTools
1414
from utils.subject_assertion import subject_assertion
1515
from utils import screening_subject_page_searcher
16-
from utils.batch_processing import (
17-
batch_processing
18-
)
16+
from utils.batch_processing import batch_processing
1917
from utils.fit_kit import FitKitLogged, FitKitGeneration
2018
from utils.oracle.subject_selection_query_builder import SubjectSelectionQueryBuilder
2119
from utils.appointments import book_appointments, book_post_investigation_appointment
@@ -206,13 +204,17 @@ def test_scenario_14(page: Page) -> None:
206204
batch_processing(
207205
page=page,
208206
batch_type="S9",
209-
batch_description="Invitation & Test Kit (FIT)",
210207
latest_event_status="S10 - Invitation & Test Kit Sent",
208+
batch_description="Invitation & Test Kit (FIT)",
211209
)
212210

213211
# When I log my subject's latest unlogged FIT kit
214212
fit_kit = FitKitGeneration().get_fit_kit_for_subject_sql(nhs_no, False, False)
215-
FitKitLogged().log_fit_kits(page=page, fit_kit=fit_kit, sample_date=datetime.now())
213+
FitKitLogged().log_fit_kits(
214+
page=page,
215+
sample_date=datetime.now(),
216+
fit_kit=fit_kit,
217+
)
216218

217219
# Then my subject has been updated as follows:
218220
subject_assertion(
@@ -222,7 +224,7 @@ def test_scenario_14(page: Page) -> None:
222224

223225
# When I read my subject's latest logged FIT kit as "ABNORMAL"
224226
FitKitLogged().read_latest_logged_kit(
225-
user=user_role, kit_type=2, kit=fit_kit, kit_result="ABNORMAL"
227+
user=user_role, kit=fit_kit, kit_type=2, kit_result="ABNORMAL"
226228
)
227229

228230
# Then my subject has been updated as follows:
@@ -279,14 +281,13 @@ def test_scenario_14(page: Page) -> None:
279281
"latest episode includes event status": "A50 Diagnosis date recorded",
280282
"latest event status": "A183 1st Colonoscopy Assessment Appointment Requested ",
281283
}
282-
subject_assertion(
283-
nhs_number=nhs_no,criteria=criteria)
284+
subject_assertion(nhs_number=nhs_no, criteria=criteria)
284285

285286
# When I process the open "A183 - 1st Colonoscopy Assessment Appointment" letter batch for my subject
286287
batch_processing(
287288
page=page,
288-
batch_type="A183",
289289
batch_description="Practitioner Clinic 1st Appointment",
290+
batch_type="A183",
290291
latest_event_status="A25 - 1st Colonoscopy Assessment Appointment Booked, letter sent",
291292
)
292293

@@ -309,15 +310,15 @@ def test_scenario_14(page: Page) -> None:
309310

310311
# And I attend the subject's practitioner appointment "2 days ago"
311312
AppointmentDetailPage(page).mark_appointment_as_attended(
312-
datetime.today() - timedelta(days=2)
313+
date=datetime.today() - timedelta(days=2)
313314
)
314315

315316
# Then my subject has been updated as follows:
316317
subject_assertion(
317-
nhs_number=nhs_no,
318318
criteria={
319319
"latest event status": "J10 Attended Colonoscopy Assessment Appointment",
320320
},
321+
nhs_number=nhs_no,
321322
)
322323

323324
# When I view the subject
@@ -339,18 +340,16 @@ def test_scenario_14(page: Page) -> None:
339340
ColonoscopyDatasetsPage(page).save_dataset()
340341

341342
# And I view the subject
342-
screening_subject_page_searcher.navigate_to_subject_summary_page(
343-
page, nhs_no
344-
)
343+
screening_subject_page_searcher.navigate_to_subject_summary_page(page, nhs_no)
345344

346345
# And I advance the subject's episode for "Suitable for Endoscopic Test"
347346
SubjectScreeningSummaryPage(page).click_advance_fobt_screening_episode_button()
348347
AdvanceFOBTScreeningEpisodePage(page).click_suitable_for_endoscopic_test_button()
349348

350349
# Then my subject has been updated as follows:
351350
subject_assertion(
352-
nhs_number=nhs_no,
353351
criteria={"latest event status": "A99 Suitable for Endoscopic Test"},
352+
nhs_number=nhs_no,
354353
)
355354

356355
# When I view the subject
@@ -411,16 +410,16 @@ def test_scenario_14(page: Page) -> None:
411410
f"{df["person_family_name"].iloc[0]} {df["person_given_name"].iloc[0]}"
412411
)
413412

414-
# And I add the following bowel preparation drugs and values within the Investigation Dataset for this subject:
415-
drug_information = {"drug_type1": DrugTypeOptions.MANNITOL, "drug_dose1": "3"}
416-
417413
# And I set the following fields and values within the Investigation Dataset for this subject:
418414
general_information = {
419415
"site": 1,
420416
"practitioner": 1,
421417
"testing clinician": person_name,
422418
"aspirant endoscopist": None,
423419
}
420+
# And I add the following bowel preparation drugs and values within the Investigation Dataset for this subject:
421+
drug_information = {"drug_type1": DrugTypeOptions.MANNITOL, "drug_dose1": "3"}
422+
# And I set the following endoscopy fields and values within the Investigation Dataset for this subject:
424423
endoscopy_information = {
425424
"endoscope inserted": "yes",
426425
"procedure type": "therapeutic",
@@ -445,11 +444,7 @@ def test_scenario_14(page: Page) -> None:
445444
# And I set the following failure reasons within the Investigation Dataset for this subject:
446445
failure_information = {"failure reasons": FailureReasonsOptions.ADHESION}
447446

448-
# And I add new polyp 1 with the following fields and values within the Investigation Dataset for this subject:
449-
# And I add new polyp 2 with the following fields and values within the Investigation Dataset for this subject:
450-
# And I add new polyp 3 with the following fields and values within the Investigation Dataset for this subject:
451-
# And I add new polyp 4 with the following fields and values within the Investigation Dataset for this subject:
452-
# And I add new polyp 5 with the following fields and values within the Investigation Dataset for this subject:
447+
# And I add new polyp 1-5 with the following fields and values within the Investigation Dataset for this subject:
453448
polyp_information = [
454449
{
455450
"location": EndoscopyLocationOptions.CAECUM,

0 commit comments

Comments
 (0)