aboutsummaryrefslogtreecommitdiff
path: root/tests/unit/test_csvcmp.py
AgeCommit message (Collapse)Author
2022-04-12Delete "get_allowable_sampledata_headers"BonfaceKilz
* gn3/csvcmp.py (get_allowable_sampledata_headers): Delete it. * tests/unit/test_csvcmp.py: Remove "get_allowable_sampledata_headers" import. (test_get_allowable_csv_headers): Delete it.
2022-04-07Add method for parsing a csv header from uploaded sample-data fileBonfaceKilz
* gn3/csvcmp.py (parse_csv_column): New function. * tests/unit/test_csvcmp.py: Test case for the above.
2022-04-01Run python-black in fileBonfaceKilz
* gn3/csvcmp.py: Run "black -l 79 ..." * tests/unit/db/test_sample_data.py: Ditto. * tests/unit/test_csvcmp.py: Ditto.
2022-03-18Clean all csv fields before diffingBonfaceKilz
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.
2022-03-18Create new function for cleaning individual fields in csv textBonfaceKilz
* gn3/csvcmp.py (clean_csv_text): New function. * tests/unit/test_csvcmp.py: Import "csv_text". (test_clean_csv_text): Test case for the above.
2022-03-14Sort import linesBonfaceKilz
2022-03-14Given a csv text and permissible headers, extract invalid headersBonfaceKilz
* gn3/csvcmp.py (extract_invalid_csv_headers): New function. * tests/unit/test_csvcmp.py: Import "extract_invalid_csv_headers". (test_extract_invalid_csv_headers_with_some_wrong_headers): Test case for the above.
2022-03-14Get all permissible column dataBonfaceKilz
* gn3/csvcmp.py: Import "Any" and "List". (get_allowable_sampledata_headers): New function. * tests/unit/test_csvcmp: Import "get_allowable_sampledata_headers". (test_get_allowable_csv_headers): Test case for the above.
2022-03-12Fix pylint errors in unit_testsBonfaceKilz
2022-03-12Fill in empty values in csv text with: "x"BonfaceKilz
* 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.
2022-03-12Extract a strain name given a csv string and it's headerBonfaceKilz
* gn3/csvcmp.py (extract_strain_name): New function. * gn3/db/sample_data (delete_sample_data): Use the aforementioned function. (insert_sample_data): Ditto. * tests/unit/test_csvcmp: Test cases for above.
2022-03-12Don't add extra key "Column" to dict if there are no changesBonfaceKilz
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.
2022-03-12Test edges cases for csv files when running csvdiffBonfaceKilz
* tests/unit/test_csvcmp.py (test_csv_diff): Delete it. (test_csv_diff_same_columns): Test csv_diff against csv texts with the same columns. (test_csv_diff_different_columns): Test csv texts against csv texts with different varying columns.
2022-03-12Create new method for filling csv with a default valueBonfaceKilz
* gn3/csvcmp.py (fill_csv): Given a csv text with uneven or incomplete fields whole length are less than width, fill them with a value which defaults to "x". * tests/unit/test_csvcmp.py (test_fill_csv): Test cases for the above.
2022-03-12Add methods for working with csv dataBonfaceKilz
gn3/csvcmp.py: New file (create_dirs_if_not_exists): From a list of dirs, create them if they don't exist. (remove_insignificant_edits): Given a dict with a "Modification" key, remove edits with "delta < ε". (csv_diff): Generate a csv_diff using the "csvdiff" tool packaged in guix. tests/unit/test_csvcmp.py: Add some tests for "gn3/csvcmp.py"