Repository: kedro-org/kedro
File: tests/framework/cli/test_cli.py (Python)

Code before:
    def fake_run_config(request, fake_root_dir):
        config_path = str(fake_root_dir / request.param)
        config = {
            "run": {
                "pipeline": "pipeline1",
                "tag": ["tag1", "tag2"],
                "node_names": ["node1", "node2"],
            }
        }
        OmegaConf.save(
            config,
            config_path,
        )
        return config_path

    @staticmethod
    @fixture(params=["run_config.yml", "run_config.json"])
    def fake_invalid_run_config(request, fake_root_dir):
        config_path = str(fake_root_dir / request.param)
        config = {
            "run": {
                "pipeline": "pipeline1",
                "tag": ["tag1", "tag2"],
                "node-names": ["node1", "node2"],
            }
        }
        OmegaConf.save(
            config,
            config_path,
        )
        return config_path

    @staticmethod
    @fixture
    def fake_run_config_with_params(fake_run_config, request):
        config = OmegaConf.to_container(OmegaConf.load(fake_run_config))
        config["run"].update(request.param)
        OmegaConf.save(config, fake_run_config)
        return fake_run_config

    def test_run_successfully(
        self, fake_project_cli, fake_metadata, fake_session, mocker
    ):
        result = CliRunner().invoke(fake_project_cli, ["run"], obj=fake_metadata)
        assert not result.exit_code

        fake_session.run.assert_called_once_with(
            tags=(),
            runner=mocker.ANY,
            node_names=(),
            from_nodes=[],

Review comment (suggestion):
```suggestion
        config = {
            "run": {
                "pipeline": "pipeline1",
                "tag": ["tag1", "tag2"],
                "node-names": ["node1", "node2"],
            }
            ,"dummy": {"dummy": "dummy"}
        }
```

If I understand correctly the config only read `run`. I test this manually and it seems to work. This is just making sure if user have arbitary configuration kedro shouldn't throw an error.

Code after:
    def fake_run_config(request, fake_root_dir):
        config_path = str(fake_root_dir / request.param)
        config = {
            "run": {
                "pipeline": "pipeline1",
                "tags": "tag1, tag2",
                "node_names": "node1, node2",
            },
            "dummy": {"dummy": "dummy"},
        }
        OmegaConf.save(
            config,
            config_path,
        )
        return config_path

    @staticmethod
    @fixture(params=["run_config.yml", "run_config.json"])
    def fake_invalid_run_config(request, fake_root_dir):
        config_path = str(fake_root_dir / request.param)
        config = {
            "run": {
                "pipeline": "pipeline1",
                "tags": "tag1, tag2",
                "node-names": "node1, node2",
            },
            "dummy": {"dummy": "dummy"},
        }
        OmegaConf.save(
            config,
            config_path,
        )
        return config_path

    @staticmethod
    @fixture
    def fake_run_config_with_params(fake_run_config, request):
        config = OmegaConf.to_container(OmegaConf.load(fake_run_config))
        config["run"].update(request.param)
        OmegaConf.save(config, fake_run_config)
        return fake_run_config

    def test_run_successfully(
        self, fake_project_cli, fake_metadata, fake_session, mocker
    ):
        result = CliRunner().invoke(fake_project_cli, ["run"], obj=fake_metadata)
        assert not result.exit_code

        fake_session.run.assert_called_once_with(
            tags=(),
            runner=mocker.ANY,