Beispiel #1
0
 def test_call_yum_in_scope(self):
     '''
     Call Yum/Dnf within the scope.
     :return:
     '''
     with patch.dict(yumpkg.__salt__, {'cmd.run_all': MagicMock(), 'config.get': MagicMock(return_value=True)}):
         yumpkg._call_yum(['-y', '--do-something'])  # pylint: disable=W0106
         yumpkg.__salt__['cmd.run_all'].assert_called_once_with(
             ['systemd-run', '--scope', 'fake-yum', '-y', '--do-something'], env={},
             output_loglevel='trace', python_shell=False)
Beispiel #2
0
 def test_call_yum_with_kwargs(self):
     '''
     Call Yum/Dnf with the optinal keyword arguments.
     :return:
     '''
     with patch.dict(yumpkg.__salt__, {'cmd.run_all': MagicMock(), 'config.get': MagicMock(return_value=False)}):
         yumpkg._call_yum(['-y', '--do-something'],
                          python_shell=True, output_loglevel='quiet', ignore_retcode=False,
                          username='******')  # pylint: disable=W0106
         yumpkg.__salt__['cmd.run_all'].assert_called_once_with(
             ['fake-yum', '-y', '--do-something'], env={}, ignore_retcode=False,
             output_loglevel='quiet', python_shell=True, username='******')