MCPcopy Create free account
hub / github.com/coze-dev/coze-go / TestAuthErrorCode_String

Function TestAuthErrorCode_String

error_test.go:79–113  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

77}
78
79func TestAuthErrorCode_String(t *testing.T) {
80 as := assert.New(t)
81 tests := []struct {
82 name string
83 code AuthErrorCode
84 want string
85 }{
86 {
87 name: "AuthorizationPending",
88 code: AuthorizationPending,
89 want: "authorization_pending",
90 },
91 {
92 name: "SlowDown",
93 code: SlowDown,
94 want: "slow_down",
95 },
96 {
97 name: "AccessDenied",
98 code: AccessDenied,
99 want: "access_denied",
100 },
101 {
102 name: "ExpiredToken",
103 code: ExpiredToken,
104 want: "expired_token",
105 },
106 }
107
108 for _, tt := range tests {
109 t.Run(tt.name, func(t *testing.T) {
110 as.Equal(tt.want, tt.code.String())
111 })
112 }
113}
114
115func TestNewCozeAuthExceptionWithoutParent(t *testing.T) {
116 as := assert.New(t)

Callers

nothing calls this directly

Calls 1

StringMethod · 0.45

Tested by

no test coverage detected