You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by GitBox <gi...@apache.org> on 2021/05/30 10:01:14 UTC

[GitHub] [servicecomb-service-center] humingcheng commented on a change in pull request #1025: Add role manage error code

humingcheng commented on a change in pull request #1025:
URL: https://github.com/apache/servicecomb-service-center/pull/1025#discussion_r642051523



##########
File path: server/service/rbac/rbac_test.go
##########
@@ -111,82 +111,6 @@ func TestInitRBAC(t *testing.T) {
 		assert.NoError(t, err)
 		assert.Greater(t, n, int64(2))
 	})
-	dao.DeleteRole(context.Background(), "tester")
-	t.Run("check is there exist role", func(t *testing.T) {
-		exist, err := dao.RoleExist(context.Background(), "admin")
-		assert.NoError(t, err)
-		assert.Equal(t, true, exist)
-
-		exist, err = dao.RoleExist(context.Background(), "developer")
-		assert.NoError(t, err)
-		assert.Equal(t, true, exist)
-
-		exist, err = dao.RoleExist(context.Background(), "tester")
-		assert.NoError(t, err)
-		assert.Equal(t, false, exist)
-	})
-
-	t.Run("delete the default role", func(t *testing.T) {
-		r, err := dao.DeleteRole(context.Background(), "admin")
-		assert.NoError(t, err)
-		assert.Equal(t, false, r)
-
-		r, err = dao.DeleteRole(context.Background(), "developer")
-		assert.NoError(t, err)
-		assert.Equal(t, false, r)
-	})
-
-	t.Run("delete the not exist role", func(t *testing.T) {
-		_, err := dao.DeleteRole(context.Background(), "tester")
-		assert.NoError(t, err)
-	})
-
-	t.Run("list exist role", func(t *testing.T) {
-		_, _, err := dao.ListRole(context.TODO())
-		assert.NoError(t, err)
-	})
-
-	tester := &rbacmodel.Role{

Review comment:
       原来的UT的地方不对,一个模块的功能,在其他地方测试。这里的UT移动到了role_dao_test.文件。




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org