From b77d028381819cb947342db4ff80590563822b4e Mon Sep 17 00:00:00 2001 From: BonfaceKilz Date: Fri, 18 Mar 2022 15:41:12 +0300 Subject: Clean all csv fields before diffing There was a subtle bug where "csvdiff" generated an error related to "different column headings" caused something akin to diffing: "a, b \n, ..." with "a, b\n, ...". * gn3/csvcmp.py (csv_diff): Clean csv texts before any diffing. * tests/unit/test_csvcmp.py (test_csv_diff_same_columns): Modify test case to capture aforementioned bug. --- tests/unit/test_csvcmp.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests/unit') diff --git a/tests/unit/test_csvcmp.py b/tests/unit/test_csvcmp.py index ec4ca71..c2fda6b 100644 --- a/tests/unit/test_csvcmp.py +++ b/tests/unit/test_csvcmp.py @@ -55,7 +55,7 @@ def test_remove_insignificant_data(): @pytest.mark.unit_test def test_csv_diff_same_columns(): """Test csv diffing on data with the same number of columns""" - assert csv_diff(base_csv="a,b\n1,2\n", delta_csv="a,b\n1,3") == { + assert csv_diff(base_csv="a,b \n1,2\n", delta_csv="a,b\n1,3") == { "Additions": [], "Deletions": [], "Columns": "", -- cgit v1.2.3