aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gn3/csvcmp.py9
-rw-r--r--tests/unit/test_csvcmp.py36
2 files changed, 0 insertions, 45 deletions
diff --git a/gn3/csvcmp.py b/gn3/csvcmp.py
index 6ad84ef..24cbee0 100644
--- a/gn3/csvcmp.py
+++ b/gn3/csvcmp.py
@@ -123,15 +123,6 @@ def fill_csv(csv_text, width, value="x"):
return "\n".join(data)
-def get_allowable_sampledata_headers(conn: Any) -> List:
- """Get a list of all the case-attributes stored in the database"""
- attributes = ["Strain Name", "Value", "SE", "Count"]
- with conn.cursor() as cursor:
- cursor.execute("SELECT Name from CaseAttribute")
- attributes += [attributes[0] for attributes in cursor.fetchall()]
- return attributes
-
-
def extract_invalid_csv_headers(allowed_headers: List, csv_text: str) -> List:
"""Check whether a csv text's columns contains valid headers"""
csv_header = []
diff --git a/tests/unit/test_csvcmp.py b/tests/unit/test_csvcmp.py
index c8b69c7..92012d3 100644
--- a/tests/unit/test_csvcmp.py
+++ b/tests/unit/test_csvcmp.py
@@ -6,7 +6,6 @@ from gn3.csvcmp import csv_diff
from gn3.csvcmp import extract_invalid_csv_headers
from gn3.csvcmp import extract_strain_name
from gn3.csvcmp import fill_csv
-from gn3.csvcmp import get_allowable_sampledata_headers
from gn3.csvcmp import parse_csv_column
from gn3.csvcmp import remove_insignificant_edits
@@ -124,41 +123,6 @@ def test_extract_strain_name():
@pytest.mark.unit_test
-def test_get_allowable_csv_headers(mocker):
- """Test that all the csv headers are fetched properly"""
- mock_conn = mocker.MagicMock()
- expected_values = [
- "Strain Name",
- "Value",
- "SE",
- "Count",
- "Condition",
- "Tissue",
- "Sex",
- "Age",
- "Ethn.",
- "PMI (hrs)",
- "pH",
- "Color",
- ]
- with mock_conn.cursor() as cursor:
- cursor.fetchall.return_value = (
- ("Condition",),
- ("Tissue",),
- ("Sex",),
- ("Age",),
- ("Ethn.",),
- ("PMI (hrs)",),
- ("pH",),
- ("Color",),
- )
- assert get_allowable_sampledata_headers(mock_conn) == expected_values
- cursor.execute.assert_called_once_with(
- "SELECT Name from CaseAttribute"
- )
-
-
-@pytest.mark.unit_test
def test_extract_invalid_csv_headers_with_some_wrong_headers():
"""Test that invalid column headers are extracted correctly from a csv
string"""