Skip to content

Commit

Permalink
updated testcase file
Browse files Browse the repository at this point in the history
  • Loading branch information
kanza-latif committed Oct 30, 2024
1 parent d205983 commit e18d01f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion config/memory_statistics.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import click
from swsscommon.swsscommon import ConfigDBConnector
from utilities_common.cli import AbbreviationGroup
# from utilities_common.cli import AbbreviationGroup


class AbbreviationGroup(click.Group):
def get_command(self, ctx, cmd_name):
Expand Down
3 changes: 2 additions & 1 deletion tests/memory_statistics_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def test_set_sampling_interval_success(self, mock_db_connector):
mock_db = MagicMock()
mock_db_connector.return_value = mock_db
mock_db.get_table.return_value = {"memory_statistics": {}}

with patch('click.echo') as mock_echo:
memory_statistics_sampling_interval(10)
mock_echo.assert_called_with("Memory statistics sampling interval set to 10 minutes.")
Expand All @@ -100,5 +100,6 @@ def test_set_sampling_interval_invalid_value(self, mock_db_connector):
memory_statistics_sampling_interval(-10)
mock_echo.assert_called_with("Invalid value for sampling interval. Please provide a positive integer.")


if __name__ == "__main__":
unittest.main()

0 comments on commit e18d01f

Please sign in to comment.