diff options
author | BonfaceKilz | 2022-03-01 16:49:54 +0300 |
---|---|---|
committer | BonfaceKilz | 2022-03-12 15:33:09 +0300 |
commit | ba006bdd5ae2053575e11539186d5c5041f070c1 (patch) | |
tree | f956eff9d5db47d206af9cb4c3115fe83e1aece5 /tests/unit/test_csvcmp.py | |
parent | 2b3494a8596f4978a64e03a8e1a1a033ac06b6b9 (diff) | |
download | genenetwork3-ba006bdd5ae2053575e11539186d5c5041f070c1.tar.gz |
Fill in empty values in csv text with: "x"
* gn3/csvcmp.py (fill_csv): Update this function to allow empty lists to be
filled with the default value(set in the args).
* tests/unit/test_csvcmp.py (test_fill_csv): Update test to capture above.
Diffstat (limited to 'tests/unit/test_csvcmp.py')
-rw-r--r-- | tests/unit/test_csvcmp.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/unit/test_csvcmp.py b/tests/unit/test_csvcmp.py index fd7aa28..3c9ba33 100644 --- a/tests/unit/test_csvcmp.py +++ b/tests/unit/test_csvcmp.py @@ -9,10 +9,10 @@ import pytest @pytest.mark.unit_test def test_fill_csv(): test_input = """ -Strain Name,Value,SE,Count -BXD1,18,x,0 -BXD12,16,x,x -BXD14,15,x,x +Strain Name,Value,SE,Count,Sex +BXD1,18,x,0, +BXD12,16,x,x, +BXD14,15,x,x, BXD15,14,x,x """ expected_output = """Strain Name,Value,SE,Count,Sex @@ -20,7 +20,7 @@ BXD1,18,x,0,x BXD12,16,x,x,x BXD14,15,x,x,x BXD15,14,x,x,x""" - assert(fill_csv(test_input, width=5, value="x")) + assert(fill_csv(test_input, width=5, value="x") == expected_output) @pytest.mark.unit_test def test_remove_insignificant_data(): |