aboutsummaryrefslogtreecommitdiff
path: root/wqflask/tests/unit
diff options
context:
space:
mode:
Diffstat (limited to 'wqflask/tests/unit')
-rw-r--r--wqflask/tests/unit/base/data.py110
-rw-r--r--wqflask/tests/unit/base/test_data_set.py115
2 files changed, 113 insertions, 112 deletions
diff --git a/wqflask/tests/unit/base/data.py b/wqflask/tests/unit/base/data.py
deleted file mode 100644
index 06a5a989..00000000
--- a/wqflask/tests/unit/base/data.py
+++ /dev/null
@@ -1,110 +0,0 @@
-gen_menu_json = """
-{
- "datasets": {
- "human": {
- "HLC": {
- "Liver mRNA": [
- [
- "320",
- "HLC_0311",
- "GSE9588 Human Liver Normal (Mar11) Both Sexes"
- ]
- ],
- "Phenotypes": [
- [
- "635",
- "HLCPublish",
- "HLC Published Phenotypes"
- ]
- ]
- }
- },
- "mouse": {
- "BXD": {
- "Genotypes": [
- [
- "600",
- "BXDGeno",
- "BXD Genotypes"
- ]
- ],
- "Hippocampus mRNA": [
- [
- "112",
- "HC_M2_0606_P",
- "Hippocampus Consortium M430v2 (Jun06) PDNN"
- ]
- ],
- "Phenotypes": [
- [
- "602",
- "BXDPublish",
- "BXD Published Phenotypes"
- ]
- ]
- }
- }
- },
- "groups": {
- "human": [
- [
- "HLC",
- "Liver: Normal Gene Expression with Genotypes (Merck)",
- "Family:None"
- ]
- ],
- "mouse": [
- [
- "BXD",
- "BXD",
- "Family:None"
- ]
- ]
- },
- "species": [
- [
- "human",
- "Human"
- ],
- [
- "mouse",
- "Mouse"
- ]
- ],
- "types": {
- "human": {
- "HLC": [
- [
- "Phenotypes",
- "Traits and Cofactors",
- "Phenotypes"
- ],
- [
- "Liver mRNA",
- "Liver mRNA",
- "Molecular Trait Datasets"
- ]
- ]
- },
- "mouse": {
- "BXD": [
- [
- "Phenotypes",
- "Traits and Cofactors",
- "Phenotypes"
- ],
- [
- "Genotypes",
- "DNA Markers and SNPs",
- "Genotypes"
- ],
- [
- "Hippocampus mRNA",
- "Hippocampus mRNA",
- "Molecular Trait Datasets"
- ]
- ]
- }
- }
-}
-"""
diff --git a/wqflask/tests/unit/base/test_data_set.py b/wqflask/tests/unit/base/test_data_set.py
index 505449a5..753981d8 100644
--- a/wqflask/tests/unit/base/test_data_set.py
+++ b/wqflask/tests/unit/base/test_data_set.py
@@ -4,10 +4,121 @@ import unittest
from unittest import mock
from wqflask import app
-from .data import gen_menu_json
from base.data_set import DatasetType
+GEN_MENU_JSON = """
+{
+ "datasets": {
+ "human": {
+ "HLC": {
+ "Liver mRNA": [
+ [
+ "320",
+ "HLC_0311",
+ "GSE9588 Human Liver Normal (Mar11) Both Sexes"
+ ]
+ ],
+ "Phenotypes": [
+ [
+ "635",
+ "HLCPublish",
+ "HLC Published Phenotypes"
+ ]
+ ]
+ }
+ },
+ "mouse": {
+ "BXD": {
+ "Genotypes": [
+ [
+ "600",
+ "BXDGeno",
+ "BXD Genotypes"
+ ]
+ ],
+ "Hippocampus mRNA": [
+ [
+ "112",
+ "HC_M2_0606_P",
+ "Hippocampus Consortium M430v2 (Jun06) PDNN"
+ ]
+ ],
+ "Phenotypes": [
+ [
+ "602",
+ "BXDPublish",
+ "BXD Published Phenotypes"
+ ]
+ ]
+ }
+ }
+ },
+ "groups": {
+ "human": [
+ [
+ "HLC",
+ "Liver: Normal Gene Expression with Genotypes (Merck)",
+ "Family:None"
+ ]
+ ],
+ "mouse": [
+ [
+ "BXD",
+ "BXD",
+ "Family:None"
+ ]
+ ]
+ },
+ "species": [
+ [
+ "human",
+ "Human"
+ ],
+ [
+ "mouse",
+ "Mouse"
+ ]
+ ],
+ "types": {
+ "human": {
+ "HLC": [
+ [
+ "Phenotypes",
+ "Traits and Cofactors",
+ "Phenotypes"
+ ],
+ [
+ "Liver mRNA",
+ "Liver mRNA",
+ "Molecular Trait Datasets"
+ ]
+ ]
+ },
+ "mouse": {
+ "BXD": [
+ [
+ "Phenotypes",
+ "Traits and Cofactors",
+ "Phenotypes"
+ ],
+ [
+ "Genotypes",
+ "DNA Markers and SNPs",
+ "Genotypes"
+ ],
+ [
+ "Hippocampus mRNA",
+ "Hippocampus mRNA",
+ "Molecular Trait Datasets"
+ ]
+ ]
+ }
+ }
+}
+"""
+
+
class TestDataSetTypes(unittest.TestCase):
"""Tests for the DataSetType class"""
@@ -50,7 +161,7 @@ class TestDataSetTypes(unittest.TestCase):
"""
with app.app_context():
- request_mock.return_value.content = gen_menu_json
+ request_mock.return_value.content = GEN_MENU_JSON
redis_mock = mock.Mock()
redis_mock.get.return_value = None
data_set = DatasetType(redis_mock)