mirror of
https://github.com/goharbor/harbor.git
synced 2024-11-23 02:35:17 +01:00
add ut for GetAllProjects()
This commit is contained in:
parent
48be0a988d
commit
3b8baf0139
@ -631,10 +631,10 @@ func TestProjectPermission(t *testing.T) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestQueryRelevantProjects(t *testing.T) {
|
func TestGetUserRelevantProjects(t *testing.T) {
|
||||||
projects, err := GetUserRelevantProjects(currentUser.UserID)
|
projects, err := GetUserRelevantProjects(currentUser.UserID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Errorf("Error occurred in QueryRelevantProjects: %v", err)
|
t.Errorf("Error occurred in GetUserRelevantProjects: %v", err)
|
||||||
}
|
}
|
||||||
if len(projects) != 2 {
|
if len(projects) != 2 {
|
||||||
t.Errorf("Expected length of relevant projects is 2, but actual: %d, the projects: %+v", len(projects), projects)
|
t.Errorf("Expected length of relevant projects is 2, but actual: %d, the projects: %+v", len(projects), projects)
|
||||||
@ -644,6 +644,13 @@ func TestQueryRelevantProjects(t *testing.T) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestGetAllProjects(t *testing.T) {
|
||||||
|
_, err := GetAllProjects()
|
||||||
|
if err != nil {
|
||||||
|
t.Errorf("Error occurred in GetAllProjects: %v", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func TestAddProjectMember(t *testing.T) {
|
func TestAddProjectMember(t *testing.T) {
|
||||||
err := AddProjectMember(currentProject.ProjectID, 1, models.DEVELOPER)
|
err := AddProjectMember(currentProject.ProjectID, 1, models.DEVELOPER)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user