コード例 #1
0
ファイル: test_rvm.py プロジェクト: nicholasmhughes/salt
def test__check_and_install_ruby():
    mock_check_rvm = MagicMock(return_value={"changes": {}, "result": True})
    mock_check_ruby = MagicMock(return_value={"changes": {}, "result": False})
    mock_install_ruby = MagicMock(return_value="")
    with patch.object(rvm, "_check_rvm", new=mock_check_rvm):
        with patch.object(rvm, "_check_ruby", new=mock_check_ruby):
            with patch.dict(rvm.__salt__, {"rvm.install_ruby": mock_install_ruby}):
                rvm._check_and_install_ruby({"changes": {}}, "1.9.3")
    mock_install_ruby.assert_called_once_with("1.9.3", runas=None, opts=None, env=None)
コード例 #2
0
ファイル: rvm_test.py プロジェクト: BackSeat/salt
 def test__check_and_install_ruby(self):
     mock_check_rvm = MagicMock(
         return_value={'changes': {}, 'result': True})
     mock_check_ruby = MagicMock(
         return_value={'changes': {}, 'result': False})
     mock_install_ruby = MagicMock(return_value="")
     with patch.object(rvm, '_check_rvm', new=mock_check_rvm):
         with patch.object(rvm, '_check_ruby', new=mock_check_ruby):
             with patch.dict(rvm.__salt__,
                             {'rvm.install_ruby': mock_install_ruby}):
                 rvm._check_and_install_ruby({'changes': {}}, '1.9.3')
     mock_install_ruby.assert_called_once_with('1.9.3', runas=None)
コード例 #3
0
ファイル: test_rvm.py プロジェクト: MalloZup/salt-2
 def test__check_and_install_ruby(self):
     mock_check_rvm = MagicMock(
         return_value={'changes': {}, 'result': True})
     mock_check_ruby = MagicMock(
         return_value={'changes': {}, 'result': False})
     mock_install_ruby = MagicMock(return_value='')
     with patch.object(rvm, '_check_rvm', new=mock_check_rvm):
         with patch.object(rvm, '_check_ruby', new=mock_check_ruby):
             with patch.dict(rvm.__salt__,
                             {'rvm.install_ruby': mock_install_ruby}):
                 rvm._check_and_install_ruby({'changes': {}}, '1.9.3')
     mock_install_ruby.assert_called_once_with('1.9.3', runas=None, opts=None, env=None)