kiwi-el8/test/unit/help_test.py
Marcus Schäfer 9c9250ebc4
Support nose and xunit style tests
The modifications in this commit allows the unit tests
to run on both, pytest 6.x (nose test layout) and the new
pytest 7.x (xunit test layout). This Fixes #2072 in a
much nicer way. Thanks much to @smarlowucf
2022-02-26 20:26:18 +01:00

24 lines
532 B
Python

from mock import patch
from pytest import raises
from kiwi.help import Help
from kiwi.exceptions import KiwiHelpNoCommandGiven
class TestHelp:
def setup(self):
self.help = Help()
def setup_method(self, cls):
self.setup()
def test_show(self):
with raises(KiwiHelpNoCommandGiven):
self.help.show(None)
@patch('subprocess.call')
def test_show_command(self, mock_process):
self.help.show('foo')
mock_process.assert_called_once_with('man 8 foo', shell=True)