コード例 #1
0
ファイル: test_lvs.py プロジェクト: cldeluna/salt
 def test_delete_service(self):
     '''
     Test for Delete the virtual service.
     '''
     with patch.object(lvs, '__detect_os', return_value='C'):
         with patch.object(lvs, '_build_cmd', return_value='B'):
             with patch.dict(lvs.__salt__,
                             {'cmd.run_all':
                              MagicMock(return_value={'retcode':
                                                      'ret',
                                                      'stderr':
                                                      'stderr'})}):
                 self.assertEqual(lvs.delete_service(), 'stderr')
コード例 #2
0
ファイル: lvs_test.py プロジェクト: DaveQB/salt
 def test_delete_service(self):
     '''
     Test for Delete the virtual service.
     '''
     with patch.object(lvs, '__detect_os', return_value='C'):
         with patch.object(lvs, '_build_cmd', return_value='B'):
             with patch.dict(lvs.__salt__,
                             {'cmd.run_all':
                              MagicMock(return_value={'retcode':
                                                      'ret',
                                                      'stderr':
                                                      'stderr'})}):
                 self.assertEqual(lvs.delete_service(), 'stderr')
コード例 #3
0
ファイル: test_lvs.py プロジェクト: mamh-mixed/saltstack-salt
 def test_delete_service(self):
     """
     Test for Delete the virtual service.
     """
     with patch.object(lvs, "__detect_os", return_value="C"):
         with patch.object(lvs, "_build_cmd", return_value="B"):
             with patch.dict(
                     lvs.__salt__,
                 {
                     "cmd.run_all":
                     MagicMock(return_value={
                         "retcode": "ret",
                         "stderr": "stderr"
                     })
                 },
             ):
                 self.assertEqual(lvs.delete_service(), "stderr")