aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/r_qtl/test_r_qtl2_control_file.py1
-rw-r--r--tests/uploader/phenotypes/test_misc.py108
-rw-r--r--tests/uploader/publications/test_misc.py1
-rw-r--r--tests/uploader/test_parse.py3
4 files changed, 100 insertions, 13 deletions
diff --git a/tests/r_qtl/test_r_qtl2_control_file.py b/tests/r_qtl/test_r_qtl2_control_file.py
index 316307d..5b9fef6 100644
--- a/tests/r_qtl/test_r_qtl2_control_file.py
+++ b/tests/r_qtl/test_r_qtl2_control_file.py
@@ -16,6 +16,7 @@ __DEFAULTS__ = {
"pheno_transposed": False,
"covar_transposed": False,
"phenocovar_transposed": False,
+ "phenonum_transposed": False,
"gmap_transposed": False,
"pmap_transposed": False,
"phenose_transposed": False
diff --git a/tests/uploader/phenotypes/test_misc.py b/tests/uploader/phenotypes/test_misc.py
index c0261aa..cf475ad 100644
--- a/tests/uploader/phenotypes/test_misc.py
+++ b/tests/uploader/phenotypes/test_misc.py
@@ -218,12 +218,54 @@ __sample_db_phenotypes_data__ = (
}
}),
__sample_db_phenotypes_data__,
- ({"PhenotypeId": 4, "xref_id": 10001, "DataId": 8967043, "StrainId": 4, "StrainName": "BXD1", "value": 77.2},
- {"PhenotypeId": 15, "xref_id": 10003, "DataId": 8967045, "StrainId": 6, "StrainName": "BXD5", "value": 503},
- {"PhenotypeId": 15, "xref_id": 10003, "DataId": 8967045, "StrainId": 7, "StrainName": "BXD6", "value": 903},
- {"PhenotypeId": 20, "xref_id": 10004, "DataId": 8967046, "StrainId": 3, "StrainName": "DBA/2J", "value": 1},
- {"PhenotypeId": 20, "xref_id": 10004, "DataId": 8967046, "StrainId": 4, "StrainName": "BXD1", "value": 8},
- {"PhenotypeId": 20, "xref_id": 10004, "DataId": 8967046, "StrainId": 5, "StrainName": "BXD2", "value": 9})),
+ ({
+ "PhenotypeId": 4,
+ "xref_id": 10001,
+ "DataId": 8967043,
+ "StrainId": 4,
+ "StrainName": "BXD1",
+ "value": 77.2
+ },
+ {
+ "PhenotypeId": 15,
+ "xref_id": 10003,
+ "DataId": 8967045,
+ "StrainId": 6,
+ "StrainName": "BXD5",
+ "value": 503
+ },
+ {
+ "PhenotypeId": 15,
+ "xref_id": 10003,
+ "DataId": 8967045,
+ "StrainId": 7,
+ "StrainName": "BXD6",
+ "value": 903
+ },
+ {
+ "PhenotypeId": 20,
+ "xref_id": 10004,
+ "DataId": 8967046,
+ "StrainId": 3,
+ "StrainName": "DBA/2J",
+ "value": 1
+ },
+ {
+ "PhenotypeId": 20,
+ "xref_id": 10004,
+ "DataId": 8967046,
+ "StrainId": 4,
+ "StrainName": "BXD1",
+ "value": 8
+ },
+ {
+ "PhenotypeId": 20,
+ "xref_id": 10004,
+ "DataId": 8967046,
+ "StrainId": 5,
+ "StrainName": "BXD2",
+ "value": 9
+ })),
# Changes — with deletions
(({
@@ -292,12 +334,54 @@ __sample_db_phenotypes_data__ = (
}
}),
__sample_db_phenotypes_data__,
- ({"PhenotypeId": 4, "xref_id": 10001, "DataId": 8967043, "StrainId": 4, "StrainName": "BXD1", "value": None},
- {"PhenotypeId": 15, "xref_id": 10003, "DataId": 8967045, "StrainId": 6, "StrainName": "BXD5", "value": None},
- {"PhenotypeId": 15, "xref_id": 10003, "DataId": 8967045, "StrainId": 7, "StrainName": "BXD6", "value": None},
- {"PhenotypeId": 20, "xref_id": 10004, "DataId": 8967046, "StrainId": 3, "StrainName": "DBA/2J", "value": 15},
- {"PhenotypeId": 20, "xref_id": 10004, "DataId": 8967046, "StrainId": 4, "StrainName": "BXD1", "value": None},
- {"PhenotypeId": 20, "xref_id": 10004, "DataId": 8967046, "StrainId": 5, "StrainName": "BXD2", "value": 24}))))
+ ({
+ "PhenotypeId": 4,
+ "xref_id": 10001,
+ "DataId": 8967043,
+ "StrainId": 4,
+ "StrainName": "BXD1",
+ "value": None
+ },
+ {
+ "PhenotypeId": 15,
+ "xref_id": 10003,
+ "DataId": 8967045,
+ "StrainId": 6,
+ "StrainName": "BXD5",
+ "value": None
+ },
+ {
+ "PhenotypeId": 15,
+ "xref_id": 10003,
+ "DataId": 8967045,
+ "StrainId": 7,
+ "StrainName": "BXD6",
+ "value": None
+ },
+ {
+ "PhenotypeId": 20,
+ "xref_id": 10004,
+ "DataId": 8967046,
+ "StrainId": 3,
+ "StrainName": "DBA/2J",
+ "value": 15
+ },
+ {
+ "PhenotypeId": 20,
+ "xref_id": 10004,
+ "DataId": 8967046,
+ "StrainId": 4,
+ "StrainName": "BXD1",
+ "value": None
+ },
+ {
+ "PhenotypeId": 20,
+ "xref_id": 10004,
+ "DataId": 8967046,
+ "StrainId": 5,
+ "StrainName": "BXD2",
+ "value": 24
+ }))))
def test_phenotypes_data_differences(filedata, dbdata, expected):
"""Test differences are computed correctly."""
assert phenotypes_data_differences(filedata, dbdata) == expected
diff --git a/tests/uploader/publications/test_misc.py b/tests/uploader/publications/test_misc.py
index 7a52941..8c7e567 100644
--- a/tests/uploader/publications/test_misc.py
+++ b/tests/uploader/publications/test_misc.py
@@ -63,5 +63,6 @@ from uploader.publications.misc import publications_differences
{"PhenotypeId": 1, "xref_id": 10004, "PublicationId": None,
"PubMed_ID": None}))))
def test_publications_differences(filedata, dbdata, pubmed2pubidmap, expected):
+ """Test publication differences — flesh out description…"""
assert publications_differences(
filedata, dbdata, pubmed2pubidmap) == expected
diff --git a/tests/uploader/test_parse.py b/tests/uploader/test_parse.py
index 076c47c..20c75b7 100644
--- a/tests/uploader/test_parse.py
+++ b/tests/uploader/test_parse.py
@@ -8,7 +8,8 @@ from uploader.jobs import job, jobsnamespace
from tests.conftest import uploadable_file_object
-def test_parse_with_existing_uploaded_file(#pylint: disable=[too-many-arguments]
+def test_parse_with_existing_uploaded_file(
+ #pylint: disable=[too-many-arguments,too-many-positional-arguments]
client,
db_url,
redis_url,