コード例 #1
0
ファイル: test_booth.py プロジェクト: gmelikov/pcs
 def test_success(self, mock_disable, mock_is_systemctl):
     commands.disable_booth(self.mock_env)
     mock_disable.assert_called_once_with(self.mock_run, "booth", self.name)
     mock_is_systemctl.assert_called_once_with()
     assert_report_item_list_equal(
         self.mock_rep.report_item_list,
         [(Severities.INFO, report_codes.SERVICE_DISABLE_SUCCESS, {
             "service": "booth",
             "node": None,
             "instance": self.name,
         })])
コード例 #2
0
ファイル: test_booth.py プロジェクト: HideoYamauchi/pcs
 def test_success(self, mock_disable, mock_is_systemctl):
     commands.disable_booth(self.mock_env, "name")
     mock_disable.assert_called_once_with(self.mock_run, "booth", "name")
     mock_is_systemctl.assert_called_once_with()
     assert_report_item_list_equal(
         self.mock_rep.report_item_list,
         [(
             Severities.INFO,
             report_codes.SERVICE_DISABLE_SUCCESS,
             {
                 "service": "booth",
                 "node": None,
                 "instance": "name",
             }
         )]
     )
コード例 #3
0
ファイル: test_booth.py プロジェクト: cwjenkins/pcs
 def test_failed(self, mock_disable, mock_is_systemctl):
     mock_disable.side_effect = DisableServiceError("booth", "msg", "name")
     assert_raise_library_error(
         lambda: commands.disable_booth(self.mock_env, "name"),
         (Severities.ERROR, report_codes.SERVICE_DISABLE_ERROR, {
             "service": "booth",
             "reason": "msg",
             "node": None,
             "instance": "name",
         }))
     mock_disable.assert_called_once_with(self.mock_run, "booth", "name")
     mock_is_systemctl.assert_called_once_with()
コード例 #4
0
ファイル: test_booth.py プロジェクト: HideoYamauchi/pcs
 def test_failed(self, mock_disable, mock_is_systemctl):
     mock_disable.side_effect = DisableServiceError("booth", "msg", "name")
     assert_raise_library_error(
         lambda: commands.disable_booth(self.mock_env, "name"),
         (
             Severities.ERROR,
             report_codes.SERVICE_DISABLE_ERROR,
             {
                 "service": "booth",
                 "reason": "msg",
                 "node": None,
                 "instance": "name",
             }
         )
     )
     mock_disable.assert_called_once_with(self.mock_run, "booth", "name")
     mock_is_systemctl.assert_called_once_with()