mirror of
https://github.com/goharbor/harbor.git
synced 2025-01-08 17:08:17 +01:00
add ut for GetAllProjects()
This commit is contained in:
parent
3b8baf0139
commit
0a5d5b638e
@ -645,10 +645,16 @@ func TestGetUserRelevantProjects(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestGetAllProjects(t *testing.T) {
|
func TestGetAllProjects(t *testing.T) {
|
||||||
_, err := GetAllProjects()
|
projects, err := GetAllProjects()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Errorf("Error occurred in GetAllProjects: %v", err)
|
t.Errorf("Error occurred in GetAllProjects: %v", err)
|
||||||
}
|
}
|
||||||
|
if len(projects) != 2 {
|
||||||
|
t.Errorf("Expected length of projects is 2, but actual: %d, the projects: %+v", len(projects), projects)
|
||||||
|
}
|
||||||
|
if projects[1].Name != projectName {
|
||||||
|
t.Errorf("Expected project name in the list: %s, actual: %s", projectName, projects[1].Name)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestAddProjectMember(t *testing.T) {
|
func TestAddProjectMember(t *testing.T) {
|
||||||
|
Loading…
Reference in New Issue
Block a user