update test cases for PMS

This commit is contained in:
Wenkai Yin 2017-06-15 15:50:15 +08:00
parent e2ff051f83
commit 49ddf27868
2 changed files with 8 additions and 5 deletions

View File

@ -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))
}

View File

@ -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,