Exemplo n.º 1
0
    def test_wire_together_all_expected_dependecies(self,
                                                    get_cluster_status_xml,
                                                    ClusterState,
                                                    ensure_wait_satisfiable,
                                                    push_cib):
        ClusterState.return_value = mock.MagicMock(node_section=mock.MagicMock(
            nodes="nodes"))
        get_cluster_status_xml.return_value = "mock get_cluster_status_xml"
        wait = 10

        with lib.cib_runner_nodes(self.env, wait) as (cib, runner, nodes):
            self.assertEqual(cib, "mocked cib")
            self.assertEqual(runner, "mocked cmd_runner")
            self.assertEqual(nodes, "nodes")
            ensure_wait_satisfiable.assert_called_once_with(wait)
            get_cluster_status_xml.assert_called_once_with("mocked cmd_runner")
            ClusterState.assert_called_once_with("mock get_cluster_status_xml")

        push_cib.assert_called_once_with("mocked cib", wait)
Exemplo n.º 2
0
    def test_wire_together_all_expected_dependecies(
        self, get_cluster_status_xml, ClusterState, ensure_wait_satisfiable,
        push_cib
    ):
        ClusterState.return_value = mock.MagicMock(
            node_section=mock.MagicMock(nodes="nodes")
        )
        get_cluster_status_xml.return_value = "mock get_cluster_status_xml"
        wait = 10

        with lib.cib_runner_nodes(self.env, wait) as (cib, runner, nodes):
            self.assertEqual(cib, "mocked cib")
            self.assertEqual(runner, "mocked cmd_runner")
            self.assertEqual(nodes, "nodes")
            ensure_wait_satisfiable.assert_called_once_with(wait)
            get_cluster_status_xml.assert_called_once_with("mocked cmd_runner")
            ClusterState.assert_called_once_with("mock get_cluster_status_xml")

        push_cib.assert_called_once_with("mocked cib", wait)
Exemplo n.º 3
0
 def run():
     # pylint: disable=unused-variable
     with lib.cib_runner_nodes(self.env,
                               "wait") as (cib, runner, nodes):
         pass
Exemplo n.º 4
0
 def run():
     #pylint: disable=unused-variable
     with lib.cib_runner_nodes(self.env, "wait") as (cib, runner, nodes):
         pass