Esempio n. 1
0
 def test_check_service(self):
     '''
     Test for Check the virtual service exists.
     '''
     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'})}):
                 with patch.object(lvs, 'get_rules', return_value='C'):
                     self.assertEqual(lvs.check_service('p', 's'),
                                      'Error: service not exists')
Esempio n. 2
0
 def test_check_service(self):
     '''
     Test for Check the virtual service exists.
     '''
     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'})}):
                 with patch.object(lvs, 'get_rules', return_value='C'):
                     self.assertEqual(lvs.check_service('p', 's'),
                                      'Error: service not exists')
Esempio n. 3
0
 def test_check_service(self):
     """
     Test for Check the virtual service exists.
     """
     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"
                     })
                 },
             ):
                 with patch.object(lvs, "get_rules", return_value="C"):
                     self.assertEqual(lvs.check_service("p", "s"),
                                      "Error: service not exists")