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: robot_test.go
    path of file: ./repos/harbor/src/server/v2.0/handler
    
    the code of the file until where you have to start completion: package handler

import (
	"github.com/goharbor/harbor/src/common/rbac"
	"github.com/goharbor/harbor/src/server/v2.0/models"
	"math"
	"testing"
)

func TestValidLevel(t *testing.T) {
	tests := []struct {
		name     string
		level    string
		expected bool
	}{
		{"project level true",
			"project",
			true,
		},
		{"system level true",
			"system",
			true,
		},
		{"unknown level false",
			"unknown",
			false,
		},
		{"systemproject level false",
			"systemproject",
			false,
		},
	}
	for _, tt := range tests {
		t.Run(tt.name, func(t *testing.T) {
			if isValidLevel(tt.level) != tt.expected {
				t.Errorf("name: %s, isValidLevel() = %#v, want %#v", tt.name, tt.level
    
func TestContainsAccess(t *testing.T) {
	system := rbac.PoliciesMap["System"]
	systests := []struct {
		name     string
		acc      *models.Access
		expected bool
	}{
		{"System ResourceRegistry push",
			&models.Access{
				Resource: rbac.ResourceRegistry.String(),
				Action:   rbac.ActionPush.String(),
			},
			false,
		},
		{"System ResourceProject delete",
			&models.Access{
				Resource: rbac.ResourceProject.String(),
				Action:   rbac.ActionDelete.String(),
			},
			false,
		},
		{"System ResourceReplicationPolicy delete",
			&models.Access{
				Resource: rbac.ResourceReplicationPolicy.String(),
				Action:   rbac.ActionDelete.String(),
			},
			true,
		},
	}
	for _, tt := range systests {
		t.Run(tt.name, func(t *testing.T) {
			ok := containsAccess(system, tt.acc)
			if ok != tt.expected {
				t.Errorf("name: %s, containsAccess() = %#v, want %#v", tt.name, tt.acc, tt.expected)
			}
		})
	}

	project := rbac.PoliciesMap["Project"]
	protests := []struct {
		name     string
		acc      *models.Access
		expected bool
	}{
		{"Project ResourceLog delete",
			&models.Access{
				Resource: rbac.ResourceLog.String(),
				Action:   rbac.ActionDelete.String(),
			},
			false,
		},
		{"Project ResourceMetadata read",
			&models.Access{
				Resource: rbac.ResourceMetadata.String(),
				Action:   rbac.ActionRead.String(),
			},
			true,
		},
		{"Project ResourceRobot create",
			&models.Access{
				Resource: rbac.ResourceRobot.String(),
				Action:   rbac.ActionCreate.String(),
			},
			false,
		},
	}
	for _, tt := range protests {
		t.Run(tt.name, func(t *testing.T) {
			ok := containsAccess(project, tt.acc)
			if ok != tt.expected {
				t.Errorf("name: %s, containsAccess() = %#v, want %#v", tt.name, tt.acc, tt.expected)
			}
		})
	}
}