From 5843f2174308eeca943acef175bd451cb3496e59 Mon Sep 17 00:00:00 2001 From: "minhac.lee" Date: Mon, 31 Oct 2022 16:54:00 +0900 Subject: [PATCH] Adding test for tmgr_logger Issue-Id: AIMLFW-9 Signed-off-by: minhac.lee Change-Id: I5b80a923a8401aa9ccb33feb052445a67cfbd113 --- kfadapter/kfadapter_util.py | 2 +- test/test_tmgr_logger.py | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 test/test_tmgr_logger.py diff --git a/kfadapter/kfadapter_util.py b/kfadapter/kfadapter_util.py index cc88d8a..cde187d 100644 --- a/kfadapter/kfadapter_util.py +++ b/kfadapter/kfadapter_util.py @@ -28,7 +28,7 @@ import time import json import requests from flask_api import status -# import kfadapter_conf +import kfadapter_conf class BadRequest(Exception): """ diff --git a/test/test_tmgr_logger.py b/test/test_tmgr_logger.py new file mode 100644 index 0000000..245f0f4 --- /dev/null +++ b/test/test_tmgr_logger.py @@ -0,0 +1,33 @@ +#================================================================================== +# +# Copyright (c) 2022 Samsung Electronics Co., Ltd. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ================================================================================== + +import sys +sys.path.append("../kfadapter") +from tmgr_logger import TMLogger + +class Test_tmgr_logger: + def setup_method(self): + self.TMGR_LOGGER_OBJ = TMLogger("../config/log_config.yaml") + + def test_get_loglevel(self): + ret = self.TMGR_LOGGER_OBJ.get_logLevel + assert ret == 'DEBUG' + + def test_get_logger(self): + ret = self.TMGR_LOGGER_OBJ.get_logger + assert ret != None \ No newline at end of file -- 2.16.6