From a45a57a08e80e1b8f4c6c641d563a344246cfc5f Mon Sep 17 00:00:00 2001 From: "kanza.latif" Date: Wed, 11 Sep 2024 10:49:29 +0500 Subject: [PATCH] resolved error --- tests/hostcfgd/hostcfgd_test.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/tests/hostcfgd/hostcfgd_test.py b/tests/hostcfgd/hostcfgd_test.py index f4725394..2e17e6b4 100644 --- a/tests/hostcfgd/hostcfgd_test.py +++ b/tests/hostcfgd/hostcfgd_test.py @@ -294,7 +294,17 @@ def test_dns_events(self): pass mocked_run_cmd.assert_has_calls([call(['systemctl', 'restart', 'resolv-config'], True, False)]) - def test_memory_statistics_event(self): + def test_memory_statistics_event(self): + HOSTCFG_DAEMON_CFG_DB = { + 'MEMORY_STATISTICS': { + 'config': { + 'enabled': 'true', + 'retention_time': '15 days', + 'sampling_interval': '5 minutes' + } + } + } + MockConfigDb.set_config_db(HOSTCFG_DAEMON_CFG_DB) daemon = hostcfgd.HostConfigDaemon() daemon.register_callbacks() @@ -321,7 +331,6 @@ def test_memory_statistics_event(self): mocked_subprocess.check_call.assert_has_calls(expected_calls, any_order=True) - class TestDnsHandler: @mock.patch('hostcfgd.run_cmd')