Skip to content

Commit

Permalink
Linting.
Browse files Browse the repository at this point in the history
My version of black does not match the team's.

Our docs do not make clear to me how I should be running the linter so
as to match the online environment.
  • Loading branch information
jadudm committed Oct 9, 2023
1 parent 3a98236 commit 37f9b3e
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 54 deletions.
2 changes: 1 addition & 1 deletion backend/audit/intakelib/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
extract_corrective_action_plan,
corrective_action_plan_named_ranges,
corrective_action_field_mapping,
corrective_action_column_mapping
corrective_action_column_mapping,
)


Expand Down
4 changes: 2 additions & 2 deletions backend/audit/intakelib/checks/__init__.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
from .runners import (
run_all_general_checks,
run_all_federal_awards_checks,
run_all_federal_awards_checks,
run_all_notes_to_sefa_checks,
run_all_audit_finding_checks,
run_all_additional_eins_checks,
run_all_additional_ueis_checks,
run_all_audit_findings_text_checks,
run_all_corrective_action_plan_checks,
run_all_secondary_auditors_checks
run_all_secondary_auditors_checks,
)
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
# Significant Deficiency
# Other Findings


def findings_grid_validation(ir):
# Values copied directly out of the UG
allowed_raw = [
Expand Down
3 changes: 1 addition & 2 deletions backend/audit/intakelib/transforms/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

from .runners import (
run_all_notes_to_sefa_transforms,
run_all_notes_to_sefa_transforms,
)
93 changes: 44 additions & 49 deletions backend/audit/test_intakelib.py
Original file line number Diff line number Diff line change
@@ -1,81 +1,76 @@
from django.test import SimpleTestCase
from copy import deepcopy
from audit.intakelib.intermediate_representation import (
ranges_to_rows,
remove_null_rows
)
from audit.intakelib.intermediate_representation import ranges_to_rows, remove_null_rows


class IRTests(SimpleTestCase):
s1 = {
"ranges": [
{
"values": [1, 2, 3, None, None],
},
{
"values": ["a", "b", "c", None, None],
},
{
"values": [8, None, 10, None, None],
}
{
"values": [1, 2, 3, None, None],
},
{
"values": ["a", "b", "c", None, None],
},
{
"values": [8, None, 10, None, None],
},
]
}

s2 = {
"ranges": [
{
"values": [1, None, None, None, None],
},
{
"values": ["a", "b", "c", None, None],
},
{
"values": [8, None, 10, None, None],
}

{
"values": [1, None, None, None, None],
},
{
"values": ["a", "b", "c", None, None],
},
{
"values": [8, None, 10, None, None],
},
]
}

r1 = {
"ranges": [
{
"values": [1, 2, 3],
},
{
"values": ["a", "b", "c"],
},
{
"values": [8, None, 10],
}
{
"values": [1, 2, 3],
},
{
"values": ["a", "b", "c"],
},
{
"values": [8, None, 10],
},
]
}

r2 = {
"ranges": [
{
"values": [1, None, None],
},
{
"values": ["a", "b", "c"],
},
{
"values": [8, None, 10],
}

{
"values": [1, None, None],
},
{
"values": ["a", "b", "c"],
},
{
"values": [8, None, 10],
},
]
}

def test_ranges_to_rows(self):

self.assertEqual(
[[1, 'a', 8], [2, 'b', None], [3, 'c', 10]],
ranges_to_rows(IRTests.s1["ranges"])
)
[[1, "a", 8], [2, "b", None], [3, "c", 10]],
ranges_to_rows(IRTests.s1["ranges"]),
)

self.assertEqual(
[[1, 'a', 8], [None, 'b', None], [None, 'c', 10]],
ranges_to_rows(IRTests.s2["ranges"])
)

[[1, "a", 8], [None, "b", None], [None, "c", 10]],
ranges_to_rows(IRTests.s2["ranges"]),
)

def test_remove_null_rows(self):
cp = deepcopy(IRTests.s1)
Expand Down

0 comments on commit 37f9b3e

Please sign in to comment.