Пример #1
0
    def test_create_delete_node_group_templates(
            self,
            mock__create_worker_node_group_template,
            mock__create_master_node_group_template,
            mock__delete_node_group_template):

        ngts_scenario = ngts.SaharaNodeGroupTemplates(self.context)
        ngts_scenario.create_delete_node_group_templates(
            "test_flavor",
            "test_plugin",
            "test_version")

        mock__create_master_node_group_template.assert_called_once_with(
            flavor_id="test_flavor",
            plugin_name="test_plugin",
            hadoop_version="test_version",
            use_autoconfig=True)
        mock__create_worker_node_group_template.assert_called_once_with(
            flavor_id="test_flavor",
            plugin_name="test_plugin",
            hadoop_version="test_version",
            use_autoconfig=True)

        mock__delete_node_group_template.assert_has_calls(calls=[
            mock.call(mock__create_master_node_group_template.return_value),
            mock.call(mock__create_worker_node_group_template.return_value)])
Пример #2
0
    def test_create_and_list_node_group_templates(
            self, mock__create_worker_node_group_template,
            mock__create_master_node_group_template,
            mock__list_node_group_templates):

        ngts_scenario = ngts.SaharaNodeGroupTemplates()
        ngts_scenario.create_and_list_node_group_templates(
            "test_flavor", "test_plugin", "test_version")

        mock__create_master_node_group_template.assert_called_once_with(
            flavor_id="test_flavor",
            plugin_name="test_plugin",
            hadoop_version="test_version")
        mock__create_worker_node_group_template.assert_called_once_with(
            flavor_id="test_flavor",
            plugin_name="test_plugin",
            hadoop_version="test_version")
        mock__list_node_group_templates.assert_called_once_with()