privilege_test.go 801 B

123456789101112131415161718192021222324252627282930313233343536
  1. package dao
  2. import (
  3. "context"
  4. "testing"
  5. "github.com/smartystreets/goconvey/convey"
  6. )
  7. // go test -test.v -test.run TestDaoPrivilegeList
  8. func TestDaoPrivilegeList(t *testing.T) {
  9. var (
  10. c = context.TODO()
  11. )
  12. convey.Convey("PrivilegeList", t, func(ctx convey.C) {
  13. res, err := d.PrivilegeList(c)
  14. ctx.Convey("Error should be nil", func(ctx convey.C) {
  15. ctx.So(err, convey.ShouldBeNil)
  16. })
  17. ctx.Convey("res should not be nil", func(ctx convey.C) {
  18. ctx.So(res, convey.ShouldNotBeNil)
  19. })
  20. })
  21. }
  22. func TestDaoPrivilegeResourcesList(t *testing.T) {
  23. var (
  24. c = context.TODO()
  25. )
  26. convey.Convey("PrivilegeResourcesList", t, func(ctx convey.C) {
  27. _, err := d.PrivilegeResourcesList(c)
  28. ctx.Convey("Error should be nil", func(ctx convey.C) {
  29. ctx.So(err, convey.ShouldBeNil)
  30. })
  31. })
  32. }