aboutsummaryrefslogtreecommitdiff
path: root/wqflask/tests/unit/base
diff options
context:
space:
mode:
authorMunyoki Kilyungi2022-09-05 12:38:03 +0300
committerBonfaceKilz2022-09-08 14:26:19 +0300
commitb555d046fb1a0370c41f470c19a9b4a4d6c13d1f (patch)
treea0d24945156bde8eaa4c315ccee11199f14582a8 /wqflask/tests/unit/base
parent3f7924fb8e2d2abfb49cdc458149d00a603f7d97 (diff)
downloadgenenetwork2-b555d046fb1a0370c41f470c19a9b4a4d6c13d1f.tar.gz
Move data.gen_menu_json to test_data_set.py
This is done to avoid relative imports. wqflask/tests/unit/base/data.py: Delete it. * wqflask/tests/unit/base/test_data_set.py: Add new variable GEN_MENU_JSON. (TestDataSetTypes.test_data_set_type_with_empty_redis): Upper-case "gen_menu_json" variable.
Diffstat (limited to 'wqflask/tests/unit/base')
-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)