aboutsummaryrefslogtreecommitdiff
path: root/gn2
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2024-03-26 10:54:07 +0300
committerFrederick Muriuki Muriithi2024-03-26 10:54:07 +0300
commit181b7f270dd05e16b36472c924552a41713272c6 (patch)
treea3d4c926c5204181b55223c73031f37560653167 /gn2
parent77af7c016749998d62b769bdd24069f511925ef9 (diff)
downloadgenenetwork2-181b7f270dd05e16b36472c924552a41713272c6.tar.gz
Revert "Update test function signatures and remove obsolete tests."
This reverts commit 77af7c016749998d62b769bdd24069f511925ef9.
Diffstat (limited to 'gn2')
-rw-r--r--gn2/tests/unit/wqflask/test_resource_manager.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/gn2/tests/unit/wqflask/test_resource_manager.py b/gn2/tests/unit/wqflask/test_resource_manager.py
index d0b1d58c..d7eb0e87 100644
--- a/gn2/tests/unit/wqflask/test_resource_manager.py
+++ b/gn2/tests/unit/wqflask/test_resource_manager.py
@@ -58,7 +58,7 @@ class TestGetUserMembership(unittest.TestCase):
class TestCheckUserAccessRole(unittest.TestCase):
"""Test cases for `get_highest_user_access_role`"""
- def test_edit_access(self):
+ def test_edit_access(self, requests_mock):
"""Test that the right access roles are set"""
response = mock.PropertyMock(return_value=json.dumps(
{
@@ -67,6 +67,7 @@ class TestCheckUserAccessRole(unittest.TestCase):
'admin': ['not-admin', 'edit-access', ],
}
))
+ type(requests_mock.return_value).content = response
self.assertEqual(get_highest_user_access_role(
resource_id="0196d92e1665091f202f",
user_id="8ad942fe-490d-453e-bd37"),
@@ -74,7 +75,7 @@ class TestCheckUserAccessRole(unittest.TestCase):
"metadata": DataRole.EDIT,
"admin": AdminRole.EDIT_ACCESS})
- def test_no_access(self):
+ def test_no_access(self, requests_mock):
response = mock.PropertyMock(return_value=json.dumps(
{
'data': ['no-access', ],
@@ -82,6 +83,7 @@ class TestCheckUserAccessRole(unittest.TestCase):
'admin': ['not-admin', ],
}
))
+ type(requests_mock.return_value).content = response
self.assertEqual(get_highest_user_access_role(
resource_id="0196d92e1665091f202f",
user_id=""),