aboutsummaryrefslogtreecommitdiff
path: root/wqflask/tests/base/test_trait.py
diff options
context:
space:
mode:
authorBonfaceKilz2020-09-17 17:21:30 +0300
committerBonfaceKilz2020-09-17 17:30:09 +0300
commit16faa26e52b1f0191595e16550d553907d2f9d67 (patch)
tree0b9d74fdbb57fabaefa99fbe82e6bc70ad4e1bdd /wqflask/tests/base/test_trait.py
parentf4a8789a5f28e1527d4c801b40176f47aa44146c (diff)
downloadgenenetwork2-16faa26e52b1f0191595e16550d553907d2f9d67.tar.gz
Fix errors in tests
* wqflask/tests/utility/test_authentication_tools.py test_check_resource_availability_non_default_mask): Mock flask's global 'g' variable properly. * wqflask/tests/base/test_trait.py: Ditto. * wqflask/tests/utility/test_authentication_tools.py: Ditto.
Diffstat (limited to 'wqflask/tests/base/test_trait.py')
-rw-r--r--wqflask/tests/base/test_trait.py9
1 files changed, 3 insertions, 6 deletions
diff --git a/wqflask/tests/base/test_trait.py b/wqflask/tests/base/test_trait.py
index 53b0d440..d333458a 100644
--- a/wqflask/tests/base/test_trait.py
+++ b/wqflask/tests/base/test_trait.py
@@ -38,9 +38,8 @@ class TestRetrieveTraitInfo(unittest.TestCase):
dataset={})
@mock.patch('base.trait.requests.get')
- @mock.patch('base.trait.g')
+ @mock.patch('base.trait.g', mock.Mock())
def test_retrieve_trait_info_with_empty_trait_info(self,
- g_mock,
requests_mock):
"""Empty trait info"""
requests_mock.return_value = TestNilResponse()
@@ -49,9 +48,8 @@ class TestRetrieveTraitInfo(unittest.TestCase):
dataset=mock.MagicMock())
@mock.patch('base.trait.requests.get')
- @mock.patch('base.trait.g')
+ @mock.patch('base.trait.g', mock.Mock())
def test_retrieve_trait_info_with_non_empty_trait_info(self,
- g_mock,
requests_mock):
"""Test that attributes are set"""
mock_dataset = mock.MagicMock()
@@ -66,9 +64,8 @@ class TestRetrieveTraitInfo(unittest.TestCase):
self.assertEqual(test_trait.d, 4)
@mock.patch('base.trait.requests.get')
- @mock.patch('base.trait.g')
+ @mock.patch('base.trait.g', mock.Mock())
def test_retrieve_trait_info_utf8_parsing(self,
- g_mock,
requests_mock):
"""Test that utf-8 strings are parsed correctly"""
utf_8_string = "test_string"