1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-08-07 06:45:23 +02:00
portainer/api/dataservices/team/tests/utils.go
2021-12-23 07:57:32 +02:00

28 lines
486 B
Go

package tests
import (
"testing"
portainer "github.com/portainer/portainer/api"
"github.com/portainer/portainer/api/datastore"
"github.com/stretchr/testify/assert"
)
type teamBuilder struct {
t *testing.T
count int
store *datastore.Store
}
func (b *teamBuilder) createNew(name string) *portainer.Team {
b.count++
team := &portainer.Team{
ID: portainer.TeamID(b.count),
Name: name,
}
err := b.store.Team().Create(team)
assert.NoError(b.t, err)
return team
}