File: help_test.py

package info (click to toggle)
kiwi 10.2.36-1
  • links: PTS, VCS
  • area: main
  • in suites: forky
  • size: 7,664 kB
  • sloc: python: 69,179; sh: 4,228; xml: 3,383; ansic: 391; makefile: 353
file content (23 lines) | stat: -rw-r--r-- 541 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
from unittest.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)