Exemplo n.º 1
0
    def test_success(
        self, mock_status_xml, mock_status, mock_push_cib, mock_get_topology,
        mock_get_resources, mock_verify
    ):
        mock_status_xml.return_value = "mock get_cluster_status_xml"
        mock_status.return_value = mock.MagicMock(
            node_section=mock.MagicMock(nodes="nodes")
        )
        mock_get_topology.return_value = "topology el"
        mock_get_resources.return_value = "resources_el"
        lib_env = create_lib_env()

        lib.verify(lib_env)

        mock_verify.assert_called_once_with(
            lib_env.report_processor,
            "topology el",
            "resources_el",
            "nodes"
        )
        mock_status_xml.assert_called_once_with("mocked cmd_runner")
        mock_status.assert_called_once_with("mock get_cluster_status_xml")
        mock_get_topology.assert_called_once_with("mocked cib")
        mock_get_resources.assert_called_once_with("mocked cib")
        mock_push_cib.assert_not_called()
Exemplo n.º 2
0
    def test_success(
        self,
        mock_status_xml,
        mock_status,
        mock_push_cib,
        mock_get_topology,
        mock_get_resources,
        mock_verify,
    ):
        mock_status_xml.return_value = "mock get_cluster_status_xml"
        mock_status.return_value = mock.MagicMock(node_section=mock.MagicMock(
            nodes="nodes"))
        mock_get_topology.return_value = "topology el"
        mock_get_resources.return_value = "resources_el"
        lib_env = create_lib_env()

        lib.verify(lib_env)

        mock_verify.assert_called_once_with("topology el", "resources_el",
                                            "nodes")
        mock_status_xml.assert_called_once_with("mocked cmd_runner")
        mock_status.assert_called_once_with("mock get_cluster_status_xml")
        mock_get_topology.assert_called_once_with("mocked cib")
        mock_get_resources.assert_called_once_with("mocked cib")
        mock_push_cib.assert_not_called()