You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: gke_test.go
    path of file: ./repos/pipeline/src/cluster
    
    the code of the file until where you have to start completion: // Copyright Â© 2018 Banzai Cloud
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package cluster

import (
	"encoding/json"
	"reflect"
	"testing"

	gke "google.golang.org/api/container/v1"

	"github.com/banzaicloud/pipeline/internal/providers/google"
	pkgClusterGoogle "github.com/banzaicloud/pipeline/pkg/cluster/gke"
	pkgCommon "github.com/banzaicloud/pipeline/pkg/common"
	pkgErrors "github.com/banzaicloud/pipeline/pkg/errors"
)

const (
	pool1Name             = "pool1"
	pool1Count            = 1
	pool1NodeInstanceType = "instanceType1"
	pool2Name             = "pool2"
	pool2Count            = 2
	pool2NodeInstanceType = "instanceType2"
	nodeVersion           = "gke-1.9"
	labelName             = "custom"
	labelValue            = "value"

	userId = 1
)

// nolint: gochecknoglobals
var (
	clusterModelWithNilNodePools = &google.GKEClusterModel{NodeVersion: nodeVersion}

	clusterModelWithEmptyNodePools = &google.GKEClusterModel{
		NodeVersion: nodeVersion,
		NodePools:   []*google.GKENodePoolModel{},
	}

	clusterModel = &google.GKEClusterModel{
		NodeVersion: nodeVersion,
		NodePools: []*google.GKENodePoolModel{
			{Name: pool1Name, NodeCount: pool1Count, NodeInstanceType: pool1NodeInstanceType},
			{Name: pool2Name, NodeCount: pool2Count, NodeInstanceType: pool2NodeInstanceType},
		},
	}
)

func TestCreateNodePoolsModelFromRequest(t *testing.T) {
	// given
	emptyNodePoolsData := map[string]*pkgClusterGoogle.NodePool{}

	modePoolsData := map[string]*pkgClusterGoogle.NodePool{
		pool1Name: {Count: pool1Count, NodeInstanceType: pool1NodeInstanceType, Labels: map[string]string{labelName: labelValue}},
		pool2Name: {Count: pool2Count, NodeInstanceType: pool2NodeInstanceType, Labels: map[string]string{labelName: labelValue}},
	}

	labels := map[string]string{labelName: labelValue}

	nodePoolsModel := []*google.GKENodePool
    
func TestCreateNodePoolsFromClusterModel(t *testing.T) {
	// given
	nodeConfig1 := &gke.NodeConfig{
		MachineType: pool1NodeInstanceType,
		OauthScopes: []string{
			"https://www.googleapis.com/auth/logging.write",
			"https://www.googleapis.com/auth/monitoring",
			"https://www.googleapis.com/auth/devstorage.read_write",
			"https://www.googleapis.com/auth/cloud-platform",
			"https://www.googleapis.com/auth/compute",
		},
		Labels: map[string]string{
			pkgCommon.LabelKey: pool1Name,
		},
	}

	nodeConfig2 := &gke.NodeConfig{
		MachineType: pool2NodeInstanceType,
		OauthScopes: []string{
			"https://www.googleapis.com/auth/logging.write",
			"https://www.googleapis.com/auth/monitoring",
			"https://www.googleapis.com/auth/devstorage.read_write",
			"https://www.googleapis.com/auth/cloud-platform",
			"https://www.googleapis.com/auth/compute",
		},
		Labels: map[string]string{
			pkgCommon.LabelKey: pool2Name,
		},
	}
	nodePools := []*gke.NodePool{
		{Name: pool1Name, Autoscaling: &gke.NodePoolAutoscaling{Enabled: false, MinNodeCount: 0, MaxNodeCount: 0}, InitialNodeCount: pool1Count, Version: nodeVersion, Config: nodeConfig1},
		{Name: pool2Name, Autoscaling: &gke.NodePoolAutoscaling{Enabled: false, MinNodeCount: 0, MaxNodeCount: 0}, InitialNodeCount: pool2Count, Version: nodeVersion, Config: nodeConfig2},
	}

	testCases := []struct {
		name         string
		clusterModel *google.GKEClusterModel
		nodePools    []*gke.NodePool
		err          error
	}{
		{name: "create node pools from nil model", clusterModel: clusterModelWithNilNodePools, nodePools: nil, err: pkgErrors.ErrorNodePoolNotProvided},
		{name: "create node pools from empty model", clusterModel: clusterModelWithEmptyNodePools, nodePools: nil, err: pkgErrors.ErrorNodePoolNotProvided},
		{name: "create node pools from model", clusterModel: clusterModel, nodePools: nodePools, err: nil},
	}

	for _, tc := range testCases {
		t.Run(tc.name, func(t *testing.T) {
			// when
			nodePools, err := createNodePoolsFromClusterModel(tc.clusterModel)

			// then
			if tc.err != err {
				t.Errorf("Expected error %#v, got: %#v", tc.err, err)
			}

			if !reflect.DeepEqual(tc.nodePools, nodePools) {
				t.Error("Expected node pools:\n")
				for _, np := range tc.nodePools {
					data, _ := json.Marshal(*np)
					t.Errorf("%v\n", string(data))
				}

				t.Error("Got:\n")
				for _, np := range nodePools {
					data, _ := json.Marshal(*np)
					t.Errorf("%v\n", string(data))
				}
			}
		})
	}
}