aboutsummaryrefslogtreecommitdiff
path: root/tests/unit
diff options
context:
space:
mode:
authorBonfaceKilz2022-03-01 15:41:56 +0300
committerBonfaceKilz2022-03-12 15:33:09 +0300
commitb6ecd0888ccf51b1dd2bfcbbbc4e03b1c5a92699 (patch)
tree59801fba61b68fb9d3f21e6441d033a57ac592b0 /tests/unit
parent59d2d0a8175c4a06c5363a8a3d3addd683ef9a8d (diff)
downloadgenenetwork3-b6ecd0888ccf51b1dd2bfcbbbc4e03b1c5a92699.tar.gz
Extract a strain name given a csv string and it's header
* 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.
Diffstat (limited to 'tests/unit')
-rw-r--r--tests/unit/test_csvcmp.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/unit/test_csvcmp.py b/tests/unit/test_csvcmp.py
index 4a96f99..fd7aa28 100644
--- a/tests/unit/test_csvcmp.py
+++ b/tests/unit/test_csvcmp.py
@@ -1,6 +1,7 @@
from gn3.csvcmp import csv_diff
from gn3.csvcmp import fill_csv
from gn3.csvcmp import remove_insignificant_edits
+from gn3.csvcmp import extract_strain_name
import pytest
@@ -99,3 +100,10 @@ BXD15,14,x,x
'Additions': [],
'Deletions': [],
'Modifications': []})
+
+
+@pytest.mark.unit_test
+def test_extract_strain_name():
+ assert(extract_strain_name(csv_header="Strain Name,Value,SE,Count",
+ data="BXD1,18,x,0") ==
+ "BXD1")