diff options
author | Arun Isaac | 2023-12-30 05:17:17 +0000 |
---|---|---|
committer | Arun Isaac | 2023-12-30 05:17:17 +0000 |
commit | 8536431f9c367c55d2ea138ab24b2d12e98f7c81 (patch) | |
tree | 1d7d272066ee675065e4d1e89fa37fdb5293e101 /gn2/tests/unit/utility/test_hmac.py | |
parent | 21d6de22641cb1b540e03cb963d12593dab16046 (diff) | |
download | genenetwork2-8536431f9c367c55d2ea138ab24b2d12e98f7c81.tar.gz |
Namespace mock paths under gn2.
Diffstat (limited to 'gn2/tests/unit/utility/test_hmac.py')
-rw-r--r-- | gn2/tests/unit/utility/test_hmac.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/gn2/tests/unit/utility/test_hmac.py b/gn2/tests/unit/utility/test_hmac.py index 2b428588..f148ea5b 100644 --- a/gn2/tests/unit/utility/test_hmac.py +++ b/gn2/tests/unit/utility/test_hmac.py @@ -11,12 +11,12 @@ from gn2.utility.hmac import hmac_creation class TestHmacUtil(unittest.TestCase): """Test Utility method for hmac creation""" - @mock.patch("utility.hmac.app.config", {'SECRET_HMAC_CODE': "secret"}) + @mock.patch("gn2.utility.hmac.app.config", {'SECRET_HMAC_CODE': "secret"}) def test_hmac_creation(self): """Test hmac creation with a utf-8 string""" self.assertEqual(hmac_creation("ファイ"), "7410466338cfe109e946") - @mock.patch("utility.hmac.app.config", + @mock.patch("gn2.utility.hmac.app.config", {'SECRET_HMAC_CODE': ('\x08\xdf\xfa\x93N\x80' '\xd9\\H@\\\x9f`\x98d^' '\xb4a;\xc6OM\x946a\xbc' @@ -29,21 +29,21 @@ class TestHmacUtil(unittest.TestCase): hmac_creation(uuid_), "af4fcf5eace9e7c864ce") - @mock.patch("utility.hmac.app.config", {'SECRET_HMAC_CODE': "secret"}) + @mock.patch("gn2.utility.hmac.app.config", {'SECRET_HMAC_CODE': "secret"}) def test_data_hmac(self): """Test data_hmac fn with a utf-8 string""" self.assertEqual(data_hmac("ファイ"), "ファイ:7410466338cfe109e946") - @mock.patch("utility.hmac.app.config", {'SECRET_HMAC_CODE': "secret"}) - @mock.patch("utility.hmac.url_for") + @mock.patch("gn2.utility.hmac.app.config", {'SECRET_HMAC_CODE': "secret"}) + @mock.patch("gn2.utility.hmac.url_for") def test_url_for_hmac_with_plain_url(self, mock_url): """Test url_for_hmac without params""" mock_url.return_value = "https://mock_url.com/ファイ/" self.assertEqual(url_for_hmac("ファイ"), "https://mock_url.com/ファイ/?hm=05bc39e659b1948f41e7") - @mock.patch("utility.hmac.app.config", {'SECRET_HMAC_CODE': "secret"}) - @mock.patch("utility.hmac.url_for") + @mock.patch("gn2.utility.hmac.app.config", {'SECRET_HMAC_CODE': "secret"}) + @mock.patch("gn2.utility.hmac.url_for") def test_url_for_hmac_with_param_in_url(self, mock_url): """Test url_for_hmac with params""" mock_url.return_value = "https://mock_url.com/?ファイ=1" |