diff options
author | BonfaceKilz | 2022-02-25 12:08:02 +0300 |
---|---|---|
committer | BonfaceKilz | 2022-03-12 15:33:09 +0300 |
commit | 8a7335cdb3fe9e906cefa719e336a7266a9b253b (patch) | |
tree | 6d57c6168269f67bc3f00a10a0f13d01d53dd1ad /tests/unit/test_csvcmp.py | |
parent | 0c1a6fb91b8bf9cf2b68ba54d8905e4c6acfd341 (diff) | |
download | genenetwork3-8a7335cdb3fe9e906cefa719e336a7266a9b253b.tar.gz |
Don't add extra key "Column" to dict if there are no changes
gn3/csvcmp.py (csv_diff): If the diff is empty, don't add an extra key
"Column" to the dictionary.
tests/unit/test_csvcmp (test_csv_diff_only_column_change): Add test-case for
the above.
Diffstat (limited to 'tests/unit/test_csvcmp.py')
-rw-r--r-- | tests/unit/test_csvcmp.py | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/unit/test_csvcmp.py b/tests/unit/test_csvcmp.py index 023415d..4a96f99 100644 --- a/tests/unit/test_csvcmp.py +++ b/tests/unit/test_csvcmp.py @@ -77,3 +77,25 @@ BXD15,14,x,x""" 'Deletions': [], 'Modifications': [{'Current': 'BXD12,16,x,x,1', 'Original': 'BXD12,16,x,x,x'}]}) + + +@pytest.mark.unit_test +def test_csv_diff_only_column_change(): + base_csv = """ +Strain Name,Value,SE,Count +BXD1,18,x,0 +BXD12,16,x,x +BXD14,15,x,x +BXD15,14,x,x +""" + delta_csv = """Strain Name,Value,SE,Count,Sex +BXD1,18,x,0 +BXD12,16,x,x +BXD14,15,x,x +BXD15,14,x,x +""" + assert(csv_diff(base_csv=base_csv, + delta_csv=delta_csv) == { + 'Additions': [], + 'Deletions': [], + 'Modifications': []}) |