mirror of
https://github.com/goharbor/harbor.git
synced 2024-11-05 01:59:44 +01:00
update test cases for PMS
This commit is contained in:
parent
e2ff051f83
commit
49ddf27868
@ -97,6 +97,9 @@ func (p *ProjectManager) get(projectIDOrName interface{}) (*project, error) {
|
||||
}
|
||||
|
||||
if len(projects) != 1 {
|
||||
for _, project := range projects {
|
||||
fmt.Printf("%v", project)
|
||||
}
|
||||
return nil, fmt.Errorf("unexpected size of project list: %d != 1", len(projects))
|
||||
}
|
||||
|
||||
|
@ -178,7 +178,7 @@ func TestParse(t *testing.T) {
|
||||
|
||||
func TestGet(t *testing.T) {
|
||||
pm := NewProjectManager(endpoint, token)
|
||||
name := "project_for_pm_based_on_pms"
|
||||
name := "project_for_test_get"
|
||||
id, err := pm.Create(&models.Project{
|
||||
Name: name,
|
||||
})
|
||||
@ -284,7 +284,7 @@ func TestExist(t *testing.T) {
|
||||
assert.False(t, exist)
|
||||
|
||||
// exist project
|
||||
name := "project_for_pm_based_on_pms"
|
||||
name := "project_for_test_exist"
|
||||
id, err := pm.Create(&models.Project{
|
||||
Name: name,
|
||||
})
|
||||
@ -317,7 +317,7 @@ func TestGetRoles(t *testing.T) {
|
||||
assert.NotNil(t, err)
|
||||
|
||||
// exist project
|
||||
name := "project_for_pm_based_on_pms"
|
||||
name := "project_for_test_get_roles"
|
||||
id, err := pm.Create(&models.Project{
|
||||
Name: name,
|
||||
})
|
||||
@ -342,7 +342,7 @@ func TestGetPublic(t *testing.T) {
|
||||
assert.Nil(t, nil)
|
||||
size := len(projects)
|
||||
|
||||
name := "project_for_pm_based_on_pms"
|
||||
name := "project_for_test_get_public"
|
||||
id, err := pm.Create(&models.Project{
|
||||
Name: name,
|
||||
Public: 1,
|
||||
@ -376,7 +376,7 @@ func TestGetByMember(t *testing.T) {
|
||||
func TestCreate(t *testing.T) {
|
||||
pm := NewProjectManager(endpoint, token)
|
||||
|
||||
name := "project_for_pm_based_on_pms"
|
||||
name := "project_for_test_create"
|
||||
id, err := pm.Create(&models.Project{
|
||||
Name: name,
|
||||
Public: 1,
|
||||
|
Loading…
Reference in New Issue
Block a user