From d8acaf34584ff02dcb52d127c1ba5bb855b605dc Mon Sep 17 00:00:00 2001 From: wangbill Date: Fri, 14 Jan 2022 16:22:59 -0600 Subject: [PATCH] Add comments to enable debug logging tests --- .../test_enable_debug_logging_functions.py | 24 ++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/tests/unittests/test_enable_debug_logging_functions.py b/tests/unittests/test_enable_debug_logging_functions.py index 6dedde52b..d3e437ae8 100644 --- a/tests/unittests/test_enable_debug_logging_functions.py +++ b/tests/unittests/test_enable_debug_logging_functions.py @@ -22,6 +22,9 @@ class TestDebugLoggingEnabledFunctions(testutils.WebHostTestCase): + """ + Tests for cx debug logging enabled case. + """ @classmethod def setUpClass(cls): os_environ = os.environ.copy() @@ -40,6 +43,10 @@ def get_script_dir(cls): return testutils.UNIT_TESTS_FOLDER / 'log_filtering_functions' def test_debug_logging_enabled(self): + """ + Verify when cx debug logging is enabled, cx function debug logs + are recorded in host logs. + """ r = self.webhost.request('GET', 'debug_logging') self.assertEqual(r.status_code, 200) self.assertEqual(r.text, 'OK-debug') @@ -52,6 +59,9 @@ def check_log_debug_logging_enabled(self, host_out: typing.List[str]): class TestDebugLoggingDisabledFunctions(testutils.WebHostTestCase): + """ + Tests for cx debug logging disabled case. + """ @classmethod def setUpClass(cls): os_environ = os.environ.copy() @@ -70,6 +80,10 @@ def get_script_dir(cls): return testutils.UNIT_TESTS_FOLDER / 'log_filtering_functions' def test_debug_logging_disabled(self): + """ + Verify when cx debug logging is disabled, cx function debug logs + are not written to host logs. + """ r = self.webhost.request('GET', 'debug_logging') self.assertEqual(r.status_code, 200) self.assertEqual(r.text, 'OK-debug') @@ -81,7 +95,11 @@ def check_log_debug_logging_disabled(self, host_out: typing.List[str]): self.assertNotIn('logging debug', host_out) -class TestLogFilteringFunctions(testutils.WebHostTestCase): +class TestDebugLogEnabledHostFilteringFunctions(testutils.WebHostTestCase): + """ + Tests for enable debug logging flag enabled and host log level is + Information case. + """ @classmethod def setUpClass(cls): host_json = TESTS_ROOT / cls.get_script_dir() / 'host.json' @@ -108,6 +126,10 @@ def get_script_dir(cls): return testutils.UNIT_TESTS_FOLDER / 'log_filtering_functions' def test_debug_logging_filtered(self): + """ + Verify when cx debug logging is enabled and host logging level + is Information, cx function debug logs are not written to host logs. + """ r = self.webhost.request('GET', 'debug_logging') self.assertEqual(r.status_code, 200) self.assertEqual(r.text, 'OK-debug')