diff --git a/regtech_data_validator/check_functions.py b/regtech_data_validator/check_functions.py index 3e6157ad..48a8de14 100644 --- a/regtech_data_validator/check_functions.py +++ b/regtech_data_validator/check_functions.py @@ -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. diff --git a/tests/test_cli.py b/tests/test_cli.py index 72759363..a080a64c 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -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": { @@ -137,7 +150,8 @@ def test_output_json(self): ] } ] - """).strip('\n') + """ + ).strip('\n') actual_output = cli.df_to_json(self.input_df)