コード例 #1
0
    def test_success(self):
        mock_communicator = mock.MagicMock(spec_set=NodeCommunicator)
        node = "node address"

        lib.remote_client_destroy(mock_communicator, node)

        mock_communicator.call_node.assert_called_once_with(
            node, "remote/qdevice_net_client_destroy", None)
コード例 #2
0
    def test_success(self):
        mock_communicator = mock.MagicMock(spec_set=NodeCommunicator)
        node = "node address"

        lib.remote_client_destroy(mock_communicator, node)

        mock_communicator.call_node.assert_called_once_with(
            node,
            "remote/qdevice_net_client_destroy",
            None
        )
コード例 #3
0
    def test_comunication_error(self):
        mock_communicator = mock.MagicMock(spec_set=NodeCommunicator)
        mock_communicator.call_node.side_effect = NodeCommunicationException(
            "node address", "command", "reason")

        self.assertRaises(
            NodeCommunicationException, lambda: lib.remote_client_destroy(
                mock_communicator, "node address"))
コード例 #4
0
    def test_comunication_error(self):
        mock_communicator = mock.MagicMock(spec_set=NodeCommunicator)
        mock_communicator.call_node.side_effect = NodeCommunicationException(
            "node address", "command", "reason"
        )

        self.assertRaises(
            NodeCommunicationException,
            lambda: lib.remote_client_destroy(mock_communicator, "node address")
        )
コード例 #5
0
ファイル: quorum.py プロジェクト: HideoYamauchi/pcs
 def do_and_report(reporter, communicator, node):
     qdevice_net.remote_client_destroy(communicator, node)
     reporter.process(
         reports.qdevice_certificate_removed_from_node(node.label)
     )
コード例 #6
0
 def do_and_report(reporter, communicator, node):
     qdevice_net.remote_client_destroy(communicator, node)
     reporter.process(
         reports.qdevice_certificate_removed_from_node(node.label))