ranger/orm/tests/unit/uuidgen/test_authentication.py
st6218 f9ce6832f2 Refactor uuid handling for Ranger service resources
This commit provides the following uuid management:

(1) Remove uuid record from database after the uuid owned by
a Ranger service (cms, fms, ims) resource is deleted.

(2) Remove stale uuid record from database when such
record is inadvertently created during unsuccessful Ranger
service resource creation.

(3) Add authentication for uuidgen service delete uuid API.

Change-Id: Ifebd68851ff6c0996e7b19d331f4dd99682bd7d2
2020-05-08 11:31:58 -07:00

19 lines
556 B
Python

from orm.services.id_generator.uuidgen.utils import authentication
from orm.tests.unit.uuidgen import FunctionalTest
import mock
from pecan import conf
class TestUtil(FunctionalTest):
def setUp(self):
FunctionalTest.setUp(self)
self.mock_response = mock.Mock()
@mock.patch('orm.common.client.keystone.keystone_utils.tokens.TokenConf')
def test_get_token_conf(self, mock_TokenConf):
mock_TokenConf.return_value = 123
token_conf = authentication.get_token_conf(conf)
self.assertEqual(token_conf, 123)