Skip to content

Commit

Permalink
resolved testing error
Browse files Browse the repository at this point in the history
  • Loading branch information
kanza-latif committed Sep 10, 2024
1 parent c7fd2e6 commit c1740b0
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions tests/hostcfgd/hostcfgd_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ def test_memory_statistics_event(self):
daemon = hostcfgd.HostConfigDaemon()
daemon.register_callbacks()
MockConfigDb.event_queue = [('MEMORY_STATISTICS', 'config')]

with mock.patch('hostcfgd.subprocess') as mocked_subprocess:
popen_mock = mock.Mock()
attrs = {'communicate.return_value': ('output', 'error')}
Expand All @@ -312,13 +312,14 @@ def test_memory_statistics_event(self):
except TimeoutError:
pass

expected = [
expected_calls = [
mock.call(['sonic-memory_statistics-config', '--enable']),
mock.call(['sonic-memory_statistics-config', '--retention_time', '15']),
mock.call(['sonic-memory_statistics-config', '--sampling_interval', '5'])
mock.call(['sonic-memory_statistics-config', '--retention_time', '15 days']),
mock.call(['sonic-memory_statistics-config', '--sampling_interval', '5 minutes'])
]

mocked_subprocess.check_call.assert_has_calls(expected, any_order=True)

mocked_subprocess.check_call.assert_has_calls(expected_calls, any_order=True)



class TestDnsHandler:
Expand Down

0 comments on commit c1740b0

Please sign in to comment.