Merge pull request #2528 from ywk253100/170615_test_case

Update test cases for PMS
This commit is contained in:
Daniel Jiang 2017-06-15 16:34:51 +08:00 committed by GitHub
commit 2a0fdc4ed2
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,