From d63e7554d6dfce4e80c2570667a0fa371235beb7 Mon Sep 17 00:00:00 2001 From: BonfaceKilz Date: Mon, 27 Jul 2020 14:31:31 +0300 Subject: Apply py-lint * wqflask/tests/base/test_data_set.py: Apply pylint --- wqflask/tests/base/test_data_set.py | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'wqflask/tests/base') diff --git a/wqflask/tests/base/test_data_set.py b/wqflask/tests/base/test_data_set.py index 44a54c7e..74799e49 100644 --- a/wqflask/tests/base/test_data_set.py +++ b/wqflask/tests/base/test_data_set.py @@ -1,3 +1,5 @@ +"""Tests for wqflask/base/data_set.py""" + import unittest import mock @@ -5,8 +7,10 @@ from wqflask import app from base.data_set import DatasetType - + class TestDataSetTypes(unittest.TestCase): + """Tests for the DataSetType class""" + def setUp(self): self.app_context = app.app_context() self.app_context.push() @@ -16,10 +20,14 @@ class TestDataSetTypes(unittest.TestCase): @mock.patch('base.data_set.g') def test_data_set_type(self, db_mock): + """Test that DatasetType returns correctly if the Redis Instance is not empty + and the name variable exists in the dictionary + + """ with app.app_context(): db_mock.get = mock.Mock() - r = mock.Mock() - r.get.return_value = """ + redis_mock = mock.Mock() + redis_mock.get.return_value = """ { "AD-cases-controls-MyersGeno": "Geno", "AD-cases-controls-MyersPublish": "Publish", @@ -32,4 +40,6 @@ class TestDataSetTypes(unittest.TestCase): "B139_K_1206_R": "ProbeSet" } """ - self.assertEqual(DatasetType(r)("All Phenotypes"), "Publish") + self.assertEqual(DatasetType(redis_mock) + ("All Phenotypes"), "Publish") + -- cgit v1.2.3