Adding test for tmgr_logger 32/9432/1
authorminhac.lee <minhac.lee@samsung.com>
Mon, 31 Oct 2022 07:54:00 +0000 (16:54 +0900)
committerminhac.lee <minhac.lee@samsung.com>
Mon, 31 Oct 2022 07:54:41 +0000 (16:54 +0900)
Issue-Id: AIMLFW-9

Signed-off-by: minhac.lee <minhac.lee@samsung.com>
Change-Id: I5b80a923a8401aa9ccb33feb052445a67cfbd113

kfadapter/kfadapter_util.py
test/test_tmgr_logger.py [new file with mode: 0644]

index cc88d8a..cde187d 100644 (file)
@@ -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 (file)
index 0000000..245f0f4
--- /dev/null
@@ -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