Skip to content

Commit

Permalink
Reformatted per black 24.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
hkeeler committed Jan 29, 2024
1 parent 56092b7 commit 968cb0e
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 10 deletions.
4 changes: 2 additions & 2 deletions regtech_data_validator/check_functions.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
"""A collection of custom check functions for the Pandera schema.
These are functions that are outside the scope of built in checks. We
These are functions that are outside the scope of built in checks. We
are not making use of Lambda functions within the schema because they
make testing difficult.
make testing difficult.
We may wish to split this module into separate files if it grows to an
unwieldy size. For now we'll just use a single module.
Expand Down
30 changes: 22 additions & 8 deletions tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,44 +69,57 @@ class TestOutputFormat:
input_df.index += 1

def test_output_pandas(self):
expected_output = dedent("""
expected_output = dedent(
"""
record_no field_name field_value validation_severity validation_id validation_name validation_desc
finding_no
1 1 uid 12345678901234567890 error E3000 uid.duplicates_in_dataset Any 'unique identifier' may not be used in mor...
2 2 uid 12345678901234567890 error E3000 uid.duplicates_in_dataset Any 'unique identifier' may not be used in mor...
""").strip('\n') # noqa: E501
"""
).strip(
'\n'
) # noqa: E501

actual_output = cli.df_to_str(self.input_df)

assert actual_output == expected_output

def test_output_table(self):
expected_output = dedent("""
expected_output = dedent(
"""
╭──────────────┬─────────────┬──────────────┬──────────────────────┬───────────────────────┬─────────────────┬───────────────────────────╮
│ finding_no │ record_no │ field_name │ field_value │ validation_severity │ validation_id │ validation_name │
├──────────────┼─────────────┼──────────────┼──────────────────────┼───────────────────────┼─────────────────┼───────────────────────────┤
│ 1 │ 1 │ uid │ 12345678901234567890 │ error │ E3000 │ uid.duplicates_in_dataset │
│ 2 │ 2 │ uid │ 12345678901234567890 │ error │ E3000 │ uid.duplicates_in_dataset │
╰──────────────┴─────────────┴──────────────┴──────────────────────┴───────────────────────┴─────────────────┴───────────────────────────╯
""").strip('\n') # noqa: E501
"""
).strip(
'\n'
) # noqa: E501

actual_output = cli.df_to_table(self.input_df)

assert actual_output == expected_output

def test_output_csv(self):
expected_output = dedent("""
expected_output = dedent(
"""
finding_no,record_no,field_name,field_value,validation_severity,validation_id,validation_name,validation_desc
1,1,uid,12345678901234567890,error,E3000,uid.duplicates_in_dataset,Any 'unique identifier' may not be used in mor...
2,2,uid,12345678901234567890,error,E3000,uid.duplicates_in_dataset,Any 'unique identifier' may not be used in mor...
""").strip('\n') # noqa: E501
"""
).strip(
'\n'
) # noqa: E501

actual_output = cli.df_to_csv(self.input_df)

assert actual_output.strip('\n') == expected_output

def test_output_json(self):
expected_output = dedent("""
expected_output = dedent(
"""
[
{
"validation": {
Expand Down Expand Up @@ -137,7 +150,8 @@ def test_output_json(self):
]
}
]
""").strip('\n')
"""
).strip('\n')

actual_output = cli.df_to_json(self.input_df)

Expand Down

0 comments on commit 968cb0e

Please sign in to comment.