Skip to content

Commit

Permalink
Added testcase for syslog.1 in log.tmpfs directory
Browse files Browse the repository at this point in the history
  • Loading branch information
mihirpat1 committed Feb 1, 2023
1 parent dd331ff commit ebff427
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions tests/show_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,3 +99,20 @@ def test_show_logging_tmpfs(run_command, cli_arguments, expected):
runner = CliRunner()
result = runner.invoke(show.cli.commands["logging"], cli_arguments)
run_command.assert_called_with(EXPECTED_BASE_COMMAND + expected, display_cmd=False)

@patch('show.main.run_command')
@patch('os.path.isfile', MagicMock(return_value=True))
@patch('os.path.exists', MagicMock(return_value=True))
@pytest.mark.parametrize(
"cli_arguments,expected",
[
([], 'cat /var/log.tmpfs/syslog.1 /var/log.tmpfs/syslog'),
(['xcvrd'], "cat /var/log.tmpfs/syslog.1 /var/log.tmpfs/syslog | grep 'xcvrd'"),
(['-l', '10'], 'cat /var/log.tmpfs/syslog.1 /var/log.tmpfs/syslog | tail -10'),
(['-f'], 'tail -F /var/log.tmpfs/syslog'),
]
)
def test_show_logging_tmpfs_syslog_1(run_command, cli_arguments, expected):
runner = CliRunner()
result = runner.invoke(show.cli.commands["logging"], cli_arguments)
run_command.assert_called_with(EXPECTED_BASE_COMMAND + expected, display_cmd=False)

0 comments on commit ebff427

Please sign in to comment.