def expect_selected_keys(self, happy_path_project):  # noqa: F811
        """Expect selected fields of the the selected model"""
        expectations = [
            {
                "database": happy_path_project.database,
                "schema": happy_path_project.test_schema,
                "alias": "inner",
            }
        ]
        results = self.run_dbt_ls(
            [
                "--model",
                "inner",
                "--output",
                "json",
                "--output-keys",
                "database",
                "schema",
                "alias",
            ]
        )
        assert len(results) == len(expectations)

        for got, expected in zip(results, expectations):
            self.assert_json_equal(got, expected)

        """Expect selected fields when --output-keys given multiple times
        """
        expectations = [
            {"database": happy_path_project.database, "schema": happy_path_project.test_schema}
        ]
        results = self.run_dbt_ls(
            [
                "--model",
                "inner",
                "--output",
                "json",
                "--output-keys",
                "database",
                "--output-keys",
                "schema",
            ]
        )
        assert len(results) == len(expectations)

        for got, expected in zip(results, expectations):
            self.assert_json_equal(got, expected)

        """Expect selected fields of the test resource types
        """
        expectations = [
            {"name": "expression_is_true_seed_b_2", "column_name": None},
            {"name": "my_favorite_test", "column_name": "id"},
            {"name": "my_second_favorite_test", "column_name": "created_at"},
            {"name": "not_null_outer_id", "column_name": "id"},
            {"name": "not_null_seed__a_", "column_name": '"a"'},
            {"name": "not_null_seed__b_", "column_name": '"b"'},
            {"name": "t"},
            {"name": "unique_model_with_lots_of_schema_configs_id", "column_name": "id"},
            {"name": "unique_outer_id", "column_name": "id"},
        ]
        results = self.run_dbt_ls(
            [
                "--resource-type",
                "test",
                "--output",
                "json",
                "--output-keys",
                "name",
                "column_name",
            ]
        )
        assert len(results) == len(expectations)

        for got, expected in zip(
            sorted(results, key=lambda x: json.loads(x).get("name")),
            sorted(expectations, key=lambda x: x.get("name")),
        ):
            self.assert_json_equal(got, expected)

        """Expect nothing (non-existent keys) for the selected models
        """
        expectations = [{}, {}]
        results = self.run_dbt_ls(
            [
                "--model",
                "inner outer",
                "--output",
                "json",
                "--output-keys",
                "non_existent_key",
            ]
        )
        assert len(results) == len(expectations)

        for got, expected in zip(results, expectations):
            self.assert_json_equal(got, expected)
Expect selected fields of the the selected model
tests/functional/list/test_list.py