code.gitea.io/gitea@v1.21.7/services/repository/review_test.go (about)

     1  // Copyright 2022 The Gitea Authors. All rights reserved.
     2  // SPDX-License-Identifier: MIT
     3  
     4  package repository
     5  
     6  import (
     7  	"testing"
     8  
     9  	"code.gitea.io/gitea/models/db"
    10  	repo_model "code.gitea.io/gitea/models/repo"
    11  	"code.gitea.io/gitea/models/unittest"
    12  
    13  	"github.com/stretchr/testify/assert"
    14  )
    15  
    16  func TestRepoGetReviewerTeams(t *testing.T) {
    17  	assert.NoError(t, unittest.PrepareTestDatabase())
    18  
    19  	repo2 := unittest.AssertExistsAndLoadBean(t, &repo_model.Repository{ID: 2})
    20  	teams, err := GetReviewerTeams(db.DefaultContext, repo2)
    21  	assert.NoError(t, err)
    22  	assert.Empty(t, teams)
    23  
    24  	repo3 := unittest.AssertExistsAndLoadBean(t, &repo_model.Repository{ID: 3})
    25  	teams, err = GetReviewerTeams(db.DefaultContext, repo3)
    26  	assert.NoError(t, err)
    27  	assert.Len(t, teams, 2)
    28  }