aboutsummaryrefslogtreecommitdiff
path: root/wqflask/tests/unit
diff options
context:
space:
mode:
Diffstat (limited to 'wqflask/tests/unit')
-rw-r--r--wqflask/tests/unit/base/test_data_set.py10
-rw-r--r--wqflask/tests/unit/wqflask/api/test_gen_menu.py68
2 files changed, 39 insertions, 39 deletions
diff --git a/wqflask/tests/unit/base/test_data_set.py b/wqflask/tests/unit/base/test_data_set.py
index ee5d6f06..66ad361d 100644
--- a/wqflask/tests/unit/base/test_data_set.py
+++ b/wqflask/tests/unit/base/test_data_set.py
@@ -88,8 +88,8 @@ class TestDataSetTypes(unittest.TestCase):
'"B139_K_1206_R": "ProbeSet", '
'"Test": "ProbeSet"}'))
db_mock.db.execute.assert_called_once_with(
- ("SELECT ProbeSetFreeze.Id FROM ProbeSetFreeze " +
- "WHERE ProbeSetFreeze.Name = \"Test\" ")
+ ("SELECT ProbeSetFreeze.Id FROM ProbeSetFreeze "
+ + "WHERE ProbeSetFreeze.Name = \"Test\" ")
)
@mock.patch('base.data_set.g')
@@ -145,9 +145,9 @@ class TestDataSetTypes(unittest.TestCase):
'"Test": "Publish"}'))
db_mock.db.execute.assert_called_with(
- ("SELECT PublishFreeze.Name " +
- "FROM PublishFreeze, InbredSet " +
- "WHERE InbredSet.Name = 'Test' AND "
+ ("SELECT PublishFreeze.Name "
+ + "FROM PublishFreeze, InbredSet "
+ + "WHERE InbredSet.Name = 'Test' AND "
"PublishFreeze.InbredSetId = InbredSet.Id")
)
diff --git a/wqflask/tests/unit/wqflask/api/test_gen_menu.py b/wqflask/tests/unit/wqflask/api/test_gen_menu.py
index 57eb1650..fd0fe52e 100644
--- a/wqflask/tests/unit/wqflask/api/test_gen_menu.py
+++ b/wqflask/tests/unit/wqflask/api/test_gen_menu.py
@@ -105,13 +105,13 @@ class TestGenMenu(unittest.TestCase):
for name in ["mouse", "human"]:
db_mock.db.execute.assert_any_call(
("SELECT InbredSet.Name, InbredSet.FullName, " +
- "IFNULL(InbredSet.Family, 'None') " +
- "FROM InbredSet, Species WHERE Species.Name " +
- "= '{}' AND InbredSet.SpeciesId = Species.Id GROUP by " +
- "InbredSet.Name ORDER BY IFNULL(InbredSet.FamilyOrder, " +
- "InbredSet.FullName) ASC, IFNULL(InbredSet.Family, " +
- "InbredSet.FullName) ASC, InbredSet.FullName ASC, " +
- "InbredSet.MenuOrderId ASC").format(name)
+ "IFNULL(InbredSet.Family, 'None') "
+ + "FROM InbredSet, Species WHERE Species.Name "
+ + "= '{}' AND InbredSet.SpeciesId = Species.Id GROUP by "
+ + "InbredSet.Name ORDER BY IFNULL(InbredSet.FamilyOrder, "
+ + "InbredSet.FullName) ASC, IFNULL(InbredSet.Family, "
+ + "InbredSet.FullName) ASC, InbredSet.FullName ASC, "
+ + "InbredSet.MenuOrderId ASC").format(name)
)
@mock.patch('wqflask.api.gen_menu.g')
@@ -172,12 +172,12 @@ class TestGenMenu(unittest.TestCase):
self.assertEqual(build_datasets("Mouse", "BXD", "Phenotypes"),
[['602', "BXDPublish", "BXD Published Phenotypes"]])
db_mock.db.execute.assert_called_with(
- "SELECT InfoFiles.GN_AccesionId, PublishFreeze.Name, " +
- "PublishFreeze.FullName FROM InfoFiles, PublishFreeze, " +
- "InbredSet WHERE InbredSet.Name = 'BXD' AND " +
- "PublishFreeze.InbredSetId = InbredSet.Id AND " +
- "InfoFiles.InfoPageName = PublishFreeze.Name " +
- "ORDER BY PublishFreeze.CreateTime ASC"
+ "SELECT InfoFiles.GN_AccesionId, PublishFreeze.Name, "
+ + "PublishFreeze.FullName FROM InfoFiles, PublishFreeze, "
+ + "InbredSet WHERE InbredSet.Name = 'BXD' AND "
+ + "PublishFreeze.InbredSetId = InbredSet.Id AND "
+ + "InfoFiles.InfoPageName = PublishFreeze.Name "
+ + "ORDER BY PublishFreeze.CreateTime ASC"
)
self.assertEqual(build_datasets("Mouse", "MDP", "Phenotypes"),
[['602', "BXDPublish", "Mouse Phenome Database"]])
@@ -221,8 +221,8 @@ class TestGenMenu(unittest.TestCase):
"SELECT InfoFiles.GN_AccesionId FROM InfoFiles, "
"GenoFreeze, InbredSet WHERE InbredSet.Name = 'HLC' AND "
"GenoFreeze.InbredSetId = InbredSet.Id AND "
- "InfoFiles.InfoPageName = GenoFreeze.ShortName " +
- "ORDER BY GenoFreeze.CreateTime DESC"
+ "InfoFiles.InfoPageName = GenoFreeze.ShortName "
+ + "ORDER BY GenoFreeze.CreateTime DESC"
)
db_mock.db.execute.return_value.fetchone.return_value = ()
self.assertEqual(build_datasets("Mouse", "HLC", "Genotypes"),
@@ -239,16 +239,16 @@ class TestGenMenu(unittest.TestCase):
"112", 'HC_M2_0606_P', "Hippocampus Consortium M430v2 (Jun06) PDNN"
]])
db_mock.db.execute.assert_called_once_with(
- "SELECT ProbeSetFreeze.Id, ProbeSetFreeze.Name, " +
- "ProbeSetFreeze.FullName FROM ProbeSetFreeze, " +
- "ProbeFreeze, InbredSet, Tissue, Species WHERE " +
- "Species.Name = 'Mouse' AND Species.Id = " +
- "InbredSet.SpeciesId AND InbredSet.Name = 'HLC' AND " +
- "ProbeSetFreeze.ProbeFreezeId = ProbeFreeze.Id AND " +
- "Tissue.Name = 'mRNA' AND ProbeFreeze.TissueId = " +
- "Tissue.Id AND ProbeFreeze.InbredSetId = InbredSet.Id AND " +
- "ProbeSetFreeze.public > 0 " +
- "ORDER BY -ProbeSetFreeze.OrderList DESC, ProbeSetFreeze.CreateTime DESC")
+ "SELECT ProbeSetFreeze.Id, ProbeSetFreeze.Name, "
+ + "ProbeSetFreeze.FullName FROM ProbeSetFreeze, "
+ + "ProbeFreeze, InbredSet, Tissue, Species WHERE "
+ + "Species.Name = 'Mouse' AND Species.Id = "
+ + "InbredSet.SpeciesId AND InbredSet.Name = 'HLC' AND "
+ + "ProbeSetFreeze.ProbeFreezeId = ProbeFreeze.Id AND "
+ + "Tissue.Name = 'mRNA' AND ProbeFreeze.TissueId = "
+ + "Tissue.Id AND ProbeFreeze.InbredSetId = InbredSet.Id AND "
+ + "ProbeSetFreeze.public > 0 "
+ + "ORDER BY -ProbeSetFreeze.OrderList DESC, ProbeSetFreeze.CreateTime DESC")
@mock.patch('wqflask.api.gen_menu.build_datasets')
@mock.patch('wqflask.api.gen_menu.g')
@@ -266,15 +266,15 @@ class TestGenMenu(unittest.TestCase):
['H', 'H', 'Molecular Traits'],
['R', 'R', 'Molecular Traits']])
db_mock.db.execute.assert_called_once_with(
- "SELECT DISTINCT Tissue.Name " +
- "FROM ProbeFreeze, ProbeSetFreeze, InbredSet, " +
- "Tissue, Species WHERE Species.Name = 'mouse' " +
- "AND Species.Id = InbredSet.SpeciesId AND " +
- "InbredSet.Name = 'random group' AND " +
- "ProbeFreeze.TissueId = Tissue.Id AND " +
- "ProbeFreeze.InbredSetId = InbredSet.Id AND " +
- "ProbeSetFreeze.ProbeFreezeId = ProbeFreeze.Id " +
- "ORDER BY Tissue.Name"
+ "SELECT DISTINCT Tissue.Name "
+ + "FROM ProbeFreeze, ProbeSetFreeze, InbredSet, "
+ + "Tissue, Species WHERE Species.Name = 'mouse' "
+ + "AND Species.Id = InbredSet.SpeciesId AND "
+ + "InbredSet.Name = 'random group' AND "
+ + "ProbeFreeze.TissueId = Tissue.Id AND "
+ + "ProbeFreeze.InbredSetId = InbredSet.Id AND "
+ + "ProbeSetFreeze.ProbeFreezeId = ProbeFreeze.Id "
+ + "ORDER BY Tissue.Name"
)
@mock.patch('wqflask.api.gen_menu.build_types')