#!/usr/bin/env python3 # -*- encoding: utf-8 -*- """ @Version: 1.0 @Python Version:3.6.6 @Author: ludq1 @File: test_my_anykeyvalue_tils @Time: 2019/2/2 9:58 @Description: """ import os from unittest import TestCase, main from cucc_common_pkg.globalconst import EnvNameConst from cucc_common_pkg.my_anykeyvalue_utils import AnyKeyValueUtils class TestUtility(TestCase): r''' TestUtility ''' def test_query_any_key(self): r''' Returns: ''' key_id = 'current_env' key_type = 'current_env' os.environ[EnvNameConst.ENV_LOCAL_RUN] = '1' os.environ[EnvNameConst.ENV_MYSQLPOOL_SERVICE] = 'http://10.0.209.148:58006' result = AnyKeyValueUtils.query_any_key(key_id, key_type=key_type) expect_result = {key_id: 'dev'} self.assertEqual(expect_result, result) if __name__ == '__main__': main()