@@ -27,7 +27,7 @@ func TestConfig_RequestCode(t *testing.T) {
27
27
defer teardown ()
28
28
29
29
mux .HandleFunc ("/api/private/unauth/account/device/authorize" , func (w http.ResponseWriter , r * http.Request ) {
30
- testMethod (t , r , http . MethodPost )
30
+ testMethod (t , r )
31
31
fmt .Fprintf (w , `{
32
32
"user_code": "QW3PYV7R",
33
33
"verification_uri": "%s/account/connect",
@@ -60,7 +60,7 @@ func TestConfig_GetToken(t *testing.T) {
60
60
defer teardown ()
61
61
62
62
mux .HandleFunc ("/api/private/unauth/account/device/token" , func (w http.ResponseWriter , r * http.Request ) {
63
- testMethod (t , r , http . MethodPost )
63
+ testMethod (t , r )
64
64
fmt .Fprint (w , `{
65
65
"access_token": "secret1",
66
66
"refresh_token": "secret2",
@@ -99,7 +99,7 @@ func TestConfig_PollToken(t *testing.T) {
99
99
defer teardown ()
100
100
101
101
mux .HandleFunc ("/api/private/unauth/account/device/token" , func (w http.ResponseWriter , r * http.Request ) {
102
- testMethod (t , r , http . MethodPost )
102
+ testMethod (t , r )
103
103
fmt .Fprint (w , `{
104
104
"access_token": "secret1",
105
105
"refresh_token": "secret2",
@@ -132,3 +132,17 @@ func TestConfig_PollToken(t *testing.T) {
132
132
t .Error (diff )
133
133
}
134
134
}
135
+
136
+ func TestConfig_Revoke (t * testing.T ) {
137
+ config , mux , teardown := setup ()
138
+ defer teardown ()
139
+
140
+ mux .HandleFunc ("/api/private/unauth/account/device/revoke" , func (w http.ResponseWriter , r * http.Request ) {
141
+ testMethod (t , r )
142
+ })
143
+
144
+ _ , err := config .Revoke (ctx , "a" , "refresh_token" )
145
+ if err != nil {
146
+ t .Fatalf ("RequestCode returned error: %v" , err )
147
+ }
148
+ }
0 commit comments