Skip to content

Commit

Permalink
Format
Browse files Browse the repository at this point in the history
  • Loading branch information
gsa-suk committed Nov 27, 2024
1 parent ccccf13 commit ee44120
Showing 1 changed file with 60 additions and 15 deletions.
75 changes: 60 additions & 15 deletions backend/support/test_cog_over.py
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,11 @@ def test_cog_assignment_from_hist(self):
sac = self._fake_sac()
sac.general_information["ein"] = UNIQUE_EIN_WITHOUT_DBKEY
cog_agency, over_agency = compute_cog_over(
sac.federal_awards, sac.submission_status, sac.ein, sac.auditee_uei, sac.general_information["audit_year"]
sac.federal_awards,
sac.submission_status,
sac.ein,
sac.auditee_uei,
sac.general_information["audit_year"],
)
self.assertEqual(cog_agency, "84")
self.assertEqual(over_agency, None)
Expand All @@ -311,7 +315,11 @@ def test_cog_assignment_with_no_hist(self):
sac = self._fake_sac()
sac.general_information["ein"] = EIN_2023_ONLY
cog_agency, over_agency = compute_cog_over(
sac.federal_awards, sac.submission_status, sac.ein, sac.auditee_uei, sac.general_information["audit_year"]
sac.federal_awards,
sac.submission_status,
sac.ein,
sac.auditee_uei,
sac.general_information["audit_year"],
)
self.assertEqual(cog_agency, "10")
self.assertEqual(over_agency, None)
Expand All @@ -325,7 +333,11 @@ def test_cog_assignment_with_multiple_hist(self):
sac = self._fake_sac()
sac.general_information["ein"] = DUP_EIN_WITHOUT_RESOLVER
cog_agency, over_agency = compute_cog_over(
sac.federal_awards, sac.submission_status, sac.ein, sac.auditee_uei, sac.general_information["audit_year"]
sac.federal_awards,
sac.submission_status,
sac.ein,
sac.auditee_uei,
sac.general_information["audit_year"],
)
self.assertEqual(cog_agency, "10")
self.assertEqual(over_agency, None)
Expand All @@ -341,7 +353,11 @@ def test_cog_assignment_with_hist_resolution(self):
sac.general_information["ein"] = RESOLVABLE_EIN_WITHOUT_BASELINE
sac.general_information["auditee_uei"] = RESOLVABLE_UEI_WITHOUT_BASELINE
cog_agency, over_agency = compute_cog_over(
sac.federal_awards, sac.submission_status, sac.ein, sac.auditee_uei, sac.general_information["audit_year"]
sac.federal_awards,
sac.submission_status,
sac.ein,
sac.auditee_uei,
sac.general_information["audit_year"],
)
self.assertEqual(cog_agency, "22")
self.assertEqual(over_agency, None)
Expand All @@ -356,7 +372,11 @@ def test_over_assignment(self):
federal_awards=self._fake_federal_awards_lt_cog_limit(),
)
cog_agency, over_agency = compute_cog_over(
sac.federal_awards, sac.submission_status, sac.ein, sac.auditee_uei, sac.general_information["audit_year"]
sac.federal_awards,
sac.submission_status,
sac.ein,
sac.auditee_uei,
sac.general_information["audit_year"],
)
self.assertEqual(cog_agency, None)
self.assertEqual(over_agency, "15")
Expand All @@ -373,7 +393,11 @@ def test_over_assignment_with_hist(self):
)
sac.general_information["ein"] = UNIQUE_EIN_WITHOUT_DBKEY
cog_agency, over_agency = compute_cog_over(
sac.federal_awards, sac.submission_status, sac.ein, sac.auditee_uei, sac.general_information["audit_year"]
sac.federal_awards,
sac.submission_status,
sac.ein,
sac.auditee_uei,
sac.general_information["audit_year"],
)
self.assertEqual(cog_agency, None)
self.assertEqual(over_agency, "15")
Expand Down Expand Up @@ -413,7 +437,11 @@ def test_cog_assignment_with_uei_in_baseline(self):
is_active=True,
)
cog_agency, over_agency = compute_cog_over(
sac.federal_awards, sac.submission_status, sac.ein, sac.auditee_uei, sac.general_information["audit_year"]
sac.federal_awards,
sac.submission_status,
sac.ein,
sac.auditee_uei,
sac.general_information["audit_year"],
)
self.assertEqual(cog_agency, BASE_COG)
self.assertEqual(over_agency, None)
Expand All @@ -439,7 +467,11 @@ def test_cog_assignment_with_uei_in_baseline_and_overris(self):
self.assertEqual(len(cbs), 1)

cog_agency, _ = compute_cog_over(
sac.federal_awards, sac.submission_status, sac.ein, sac.auditee_uei, sac.general_information["audit_year"]
sac.federal_awards,
sac.submission_status,
sac.ein,
sac.auditee_uei,
sac.general_information["audit_year"],
)
record_cog_assignment(sac.report_id, sac.submitted_by, cog_agency)
cas = CognizantAssignment.objects.all()
Expand Down Expand Up @@ -467,7 +499,11 @@ def test_cog_assignment_with_uei_in_baseline_and_overris(self):
sac.cognizant_agency = None
sac.save()
cog_agency, _ = compute_cog_over(
sac.federal_awards, sac.submission_status, sac.ein, sac.auditee_uei, sac.general_information["audit_year"]
sac.federal_awards,
sac.submission_status,
sac.ein,
sac.auditee_uei,
sac.general_information["audit_year"],
)
record_cog_assignment(sac.report_id, sac.submitted_by, cog_agency)
sac = SingleAuditChecklist.objects.get(report_id=sac.report_id)
Expand Down Expand Up @@ -506,8 +542,11 @@ def test_cog_assignment_for_2024_audit(self):
sac.save()

cog_agency, over_agency = compute_cog_over(
sac.federal_awards, sac.submission_status, sac.general_information["ein"],
sac.general_information["auditee_uei"], sac.general_information["audit_year"]
sac.federal_awards,
sac.submission_status,
sac.general_information["ein"],
sac.general_information["auditee_uei"],
sac.general_information["audit_year"],
)
self.assertEqual(cog_agency, "84")
self.assertEqual(over_agency, None)
Expand Down Expand Up @@ -545,8 +584,11 @@ def test_cog_assignment_for_2027_w_baseline(self):
sac.save()

cog_agency, over_agency = compute_cog_over(
sac.federal_awards, sac.submission_status, sac.general_information["ein"],
sac.general_information["auditee_uei"], sac.general_information["audit_year"]
sac.federal_awards,
sac.submission_status,
sac.general_information["ein"],
sac.general_information["auditee_uei"],
sac.general_information["audit_year"],
)
self.assertEqual(cog_agency, "84")
self.assertEqual(over_agency, None)
Expand Down Expand Up @@ -584,8 +626,11 @@ def test_cog_assignment_for_2027_no_baseline(self):
sac.save()

cog_agency, over_agency = compute_cog_over(
sac.federal_awards, sac.submission_status, sac.general_information["ein"],
sac.general_information["auditee_uei"], sac.general_information["audit_year"]
sac.federal_awards,
sac.submission_status,
sac.general_information["ein"],
sac.general_information["auditee_uei"],
sac.general_information["audit_year"],
)
self.assertEqual(cog_agency, "10")
self.assertEqual(over_agency, None)

0 comments on commit ee44120

Please sign in to comment.