Skip to content

Commit

Permalink
Logrotate: Align tests
Browse files Browse the repository at this point in the history
Signed-off-by: Yevhen Fastiuk <yfastiuk@nvidia.com>
  • Loading branch information
fastiuk committed May 27, 2024
1 parent 110cb43 commit e2e4539
Showing 1 changed file with 8 additions and 16 deletions.
24 changes: 8 additions & 16 deletions tests/config_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -3108,10 +3108,8 @@ def test_logrotate_disk_percentage(self):
runner = CliRunner()
obj = {'db': Db().cfgdb}

result = runner.invoke(
config.config.commands['logrotate'].commands['debug'],
['disk-percentage', '24.25'], obj=obj)

result = runner.invoke(config.config.commands['logrotate'],
['debug', 'disk-percentage', '24.25'], obj=obj)
assert result.exit_code == 0

@patch('utilities_common.cli.run_command',
Expand All @@ -3120,10 +3118,8 @@ def test_logrotate_frequency(self):
runner = CliRunner()
obj = {'db': Db().cfgdb}

result = runner.invoke(
config.config.commands['logrotate'].commands['debug'],
['frequency', 'daily'], obj=obj)

result = runner.invoke(config.config.commands['logrotate'],
['debug', 'frequency', 'daily'], obj=obj)
assert result.exit_code == 0

@patch('utilities_common.cli.run_command',
Expand All @@ -3132,10 +3128,8 @@ def test_logrotate_max_number(self):
runner = CliRunner()
obj = {'db': Db().cfgdb}

result = runner.invoke(
config.config.commands['logrotate'].commands['syslog'],
['max-number', '2024'], obj=obj)

result = runner.invoke(config.config.commands['logrotate'],
['syslog', 'max-number', '2024'], obj=obj)
assert result.exit_code == 0

@patch('utilities_common.cli.run_command',
Expand All @@ -3144,10 +3138,8 @@ def test_logrotate_size(self):
runner = CliRunner()
obj = {'db': Db().cfgdb}

result = runner.invoke(
config.config.commands['logrotate'].commands['syslog'],
['size', '30.0'], obj=obj)

result = runner.invoke(config.config.commands['logrotate'],
['syslog', 'size', '30.0'], obj=obj)
assert result.exit_code == 0

@classmethod
Expand Down

0 comments on commit e2e4539

Please sign in to comment.